Update app.py
Browse files
app.py
CHANGED
@@ -22,10 +22,10 @@ def get_result_text_es_pt (list_entity, text, lang):
|
|
22 |
# check subwords
|
23 |
if word[0] == "#":
|
24 |
subword = True
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
|
30 |
if tag == "l":
|
31 |
word = word
|
@@ -67,10 +67,10 @@ def get_result_text_ca (list_entity, text):
|
|
67 |
# check subwords
|
68 |
if word[0] != "Ġ":
|
69 |
subword = True
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
else:
|
75 |
word = text[start:end]
|
76 |
|
|
|
22 |
# check subwords
|
23 |
if word[0] == "#":
|
24 |
subword = True
|
25 |
+
p_s = list_entity[idx-1]["start"]
|
26 |
+
p_e = list_entity[idx-1]["end"]
|
27 |
+
# word = result_words[-1].replace(punc_in, "") + text[start:end]
|
28 |
+
word = text[p_s:p_e] + text[start:end]
|
29 |
|
30 |
if tag == "l":
|
31 |
word = word
|
|
|
67 |
# check subwords
|
68 |
if word[0] != "Ġ":
|
69 |
subword = True
|
70 |
+
p_s = list_entity[idx-1]["start"]
|
71 |
+
p_e = list_entity[idx-1]["end"]
|
72 |
+
# word = result_words[-1].replace(punc_in, "") + text[start:end]
|
73 |
+
word = text[p_s:p_e] + text[start:end]
|
74 |
else:
|
75 |
word = text[start:end]
|
76 |
|