bourdoiscatie commited on
Commit
3bfad63
1 Parent(s): 85cb398

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -21,12 +21,12 @@ def load_model(version,text):
21
  result = ner(text)
22
  return result
23
  else:
24
- ner = pipeline('token-classification', model='bourdoiscatie/camembert-base-frenchNER_4entities', tokenizer='bourdoiscatie/camembert-base-frenchNER_4entities', grouped_entities=True)
25
  result = ner(text)
26
  return result
27
 
28
  def getcolor(texts, labels):
29
- colors = {'LOC': '#38419D', 'PER': '#BF3131', 'ORG': '#597E52', 'MISC':'#F1C232', 'ISC':'#F1C232'}
30
  return [(t,l,colors[l]) for t, l in zip(texts, labels)]
31
 
32
  def color_annotation(to_print,transcript) :
 
21
  result = ner(text)
22
  return result
23
  else:
24
+ ner = pipeline('token-classification', model='bourdoiscatie/camembert-base-frenchNER_4entities', tokenizer='bourdoiscatie/camembert-base-frenchNER_4entities', aggregation_strategy="max")
25
  result = ner(text)
26
  return result
27
 
28
  def getcolor(texts, labels):
29
+ colors = {'LOC': '#38419D', 'PER': '#BF3131', 'ORG': '#597E52', 'MISC':'#F1C232'}
30
  return [(t,l,colors[l]) for t, l in zip(texts, labels)]
31
 
32
  def color_annotation(to_print,transcript) :