jcg00v commited on
Commit
956bc8b
1 Parent(s): 725ec24

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
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
- if punc_in != "":
26
- word = result_words[-1].replace(punc_in, "") + text[start:end]
27
- else:
28
- word = result_words[-1] + text[start:end]
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
- if punc_in != "":
71
- word = result_words[-1].replace(punc_in, "") + text[start:end]
72
- else:
73
- word = result_words[-1] + text[start:end]
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