Towhidul commited on
Commit
ef00b69
1 Parent(s): 09bf063

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -34,7 +34,12 @@ predictor = Predictor.from_path("structured-prediction-srl-bert.tar.gz")
34
 
35
  #---------------------------------------------------------------
36
  def claim(text):
 
37
  df = pd.DataFrame({'claim' : [text]})
 
 
 
 
38
  def srl_allennlp(sent):
39
  try:
40
  #result = predictor.predict(sentence=sent)['verbs'][0]['description']
 
34
 
35
  #---------------------------------------------------------------
36
  def claim(text):
37
+ import re
38
  df = pd.DataFrame({'claim' : [text]})
39
+ pattern = r'(\d+),(\d+)'
40
+ def remove_number_commas(match):
41
+ return match.group(1) + match.group(2)
42
+ df['claim'] = df['claim'].apply(lambda x: re.sub(pattern, remove_number_commas, x))
43
  def srl_allennlp(sent):
44
  try:
45
  #result = predictor.predict(sentence=sent)['verbs'][0]['description']