Spaces:
Running
Running
Commit
·
4da946e
1
Parent(s):
3d89a99
Update app.py
Browse files
app.py
CHANGED
@@ -17,16 +17,16 @@ st.sidebar.image(image, caption=None, width=None, use_column_width=None, clamp=F
|
|
17 |
@st.cache_resource
|
18 |
def load_model(version,text):
|
19 |
if version == "version base":
|
20 |
-
ner = pipeline('token-classification', model='bourdoiscatie/
|
21 |
result = ner(text)
|
22 |
return result
|
23 |
else:
|
24 |
-
ner = pipeline('token-classification', model='bourdoiscatie/
|
25 |
result = ner(text)
|
26 |
return result
|
27 |
|
28 |
def getcolor(texts, labels):
|
29 |
-
colors = {'LOC': '#38419D', 'PER': '#BF3131', 'ORG': '#597E52'}
|
30 |
return [(t,l,colors[l]) for t, l in zip(texts, labels)]
|
31 |
|
32 |
def color_annotation(to_print,transcript) :
|
|
|
17 |
@st.cache_resource
|
18 |
def load_model(version,text):
|
19 |
if version == "version base":
|
20 |
+
ner = pipeline('token-classification', model='bourdoiscatie/camembert-base-frenchNER_3entities', tokenizer='bourdoiscatie/camembert-base-frenchNER_3entities', grouped_entities=True)
|
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'}
|
30 |
return [(t,l,colors[l]) for t, l in zip(texts, labels)]
|
31 |
|
32 |
def color_annotation(to_print,transcript) :
|