richylyq commited on
Commit
6c18750
1 Parent(s): 350bfee

change name for article text box

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -41,7 +41,7 @@ def detect_lang(article, target_lang):
41
  return result_lang[0]
42
 
43
 
44
- def opus_trans(message, target_lang):
45
  """
46
  Translation by Helsinki-NLP model
47
 
@@ -62,7 +62,7 @@ def opus_trans(message, target_lang):
62
  task_name = f"translation_{result_lang}_to_{target_lang}"
63
  model_name = f"Helsinki-NLP/opus-mt-{result_lang}-{target_lang}"
64
  translator = pipeline(task_name, model=model_name, tokenizer=model_name)
65
- translated = translator(message)[0]["translation_text"]
66
  print(translated)
67
  return translated
68
 
 
41
  return result_lang[0]
42
 
43
 
44
+ def opus_trans(article, target_lang):
45
  """
46
  Translation by Helsinki-NLP model
47
 
 
62
  task_name = f"translation_{result_lang}_to_{target_lang}"
63
  model_name = f"Helsinki-NLP/opus-mt-{result_lang}-{target_lang}"
64
  translator = pipeline(task_name, model=model_name, tokenizer=model_name)
65
+ translated = translator(article)[0]["translation_text"]
66
  print(translated)
67
  return translated
68