Spaces:
Runtime error
Runtime error
Stefan Dumitrescu
commited on
Commit
·
f2a57c9
1
Parent(s):
ba9d20e
Update
Browse files
app.py
CHANGED
@@ -6,7 +6,8 @@ import roner
|
|
6 |
|
7 |
example_list = [
|
8 |
"Ana merge în București.",
|
9 |
-
"
|
|
|
10 |
]
|
11 |
|
12 |
st.set_page_config(layout="wide")
|
@@ -63,7 +64,7 @@ if Run_Button == True:
|
|
63 |
"entity": word["tag"],
|
64 |
"start_char": word["start_char"],
|
65 |
"end_char": word["end_char"],
|
66 |
-
"
|
67 |
})
|
68 |
df = pd.DataFrame.from_dict(data)
|
69 |
st.subheader("Recognized Entities")
|
@@ -88,6 +89,7 @@ if Run_Button == True:
|
|
88 |
if words[j]["tag"] == words[i]["tag"] and words[j]["multi_word_entity"] is True:
|
89 |
end = words[j]["end_char"]
|
90 |
i = j
|
|
|
91 |
|
92 |
spacy_display["ents"].append({"start": start, "end": end, "label": label})
|
93 |
i += 1
|
@@ -98,6 +100,7 @@ if Run_Button == True:
|
|
98 |
'EVENT', 'LANGUAGE', 'WORK_OF_ART', 'DATETIME',
|
99 |
'PERIOD', 'MONEY', 'QUANTITY', 'NUMERIC',
|
100 |
'ORDINAL', 'FACILITY']
|
|
|
101 |
colors = {
|
102 |
'PERSON': '#E08989',
|
103 |
'ORG': '#54478C',
|
|
|
6 |
|
7 |
example_list = [
|
8 |
"Ana merge în București.",
|
9 |
+
"Președintele Statelor Unite, Joe Biden, a spus, vineri, că va trimite un număr de militari americani în Europa de Est „în curând”, ca urmare a situației tot mai tensionate din Ucraina. Președintele american a spus că „nu va trimite foarte mult” și a exclus din nou posibilitatea desfășurării de trupe în Ucraina, care nu face parte din Alianța Nord-Atlantică.",
|
10 |
+
"Deficitul bugetar a crescut semnificativ în ultima lună a anului trecut, cu 24,02 miliarde de lei, după ce, în noiembrie, Finanţele raportau un sold negativ de 4,7% din PIB, respectiv 55,98 miliarde de lei. Pe de altă parte, faţă de 2020, deficitul bugetar a consemnat o scădere importantă, de la 9,61% din PIB, respectiv 101,8 miliarde de lei."
|
11 |
]
|
12 |
|
13 |
st.set_page_config(layout="wide")
|
|
|
64 |
"entity": word["tag"],
|
65 |
"start_char": word["start_char"],
|
66 |
"end_char": word["end_char"],
|
67 |
+
"multi_word_entity (cont.)": word["multi_word_entity"]
|
68 |
})
|
69 |
df = pd.DataFrame.from_dict(data)
|
70 |
st.subheader("Recognized Entities")
|
|
|
89 |
if words[j]["tag"] == words[i]["tag"] and words[j]["multi_word_entity"] is True:
|
90 |
end = words[j]["end_char"]
|
91 |
i = j
|
92 |
+
j -= 1
|
93 |
|
94 |
spacy_display["ents"].append({"start": start, "end": end, "label": label})
|
95 |
i += 1
|
|
|
100 |
'EVENT', 'LANGUAGE', 'WORK_OF_ART', 'DATETIME',
|
101 |
'PERIOD', 'MONEY', 'QUANTITY', 'NUMERIC',
|
102 |
'ORDINAL', 'FACILITY']
|
103 |
+
|
104 |
colors = {
|
105 |
'PERSON': '#E08989',
|
106 |
'ORG': '#54478C',
|