Howosn commited on
Commit
d4520ce
·
verified ·
1 Parent(s): 7825dd0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -3,7 +3,8 @@ from transformers import pipeline
3
 
4
 
5
  # Load the summarization & translation model pipeline
6
- tran_sum_pipe = pipeline("translation", model='utrobinmv/t5_summary_en_ru_zh_base_2048')
 
7
  sentiment_pipeline = pipeline("text-classification", model='Howosn/Sentiment_Model',return_all_scores=True)
8
  #tokenizer = AutoTokenizer.from_pretrained('Howosn/Sentiment_Model', use_fast=False)
9
 
@@ -17,9 +18,9 @@ text = st.text_area("Enter the text", "")
17
  # Perform analysis result when the user clicks the "Analyse" button
18
  if st.button("Analyse"):
19
  # Perform text classification on the input text
20
- trans_sum = tran_sum_pipe(text)[0]
21
- results = sentiment_pipeline(trans_sum)[0]
22
-
23
  # Display the classification result
24
  max_score = float('-inf')
25
  max_label = ''
 
3
 
4
 
5
  # Load the summarization & translation model pipeline
6
+ #tran_sum_pipe = pipeline("translation", model='utrobinmv/t5_summary_en_ru_zh_base_2048')
7
+ trans_pipe = pipeline("translation", model='liam168/trans-opus-mt-zh-en')
8
  sentiment_pipeline = pipeline("text-classification", model='Howosn/Sentiment_Model',return_all_scores=True)
9
  #tokenizer = AutoTokenizer.from_pretrained('Howosn/Sentiment_Model', use_fast=False)
10
 
 
18
  # Perform analysis result when the user clicks the "Analyse" button
19
  if st.button("Analyse"):
20
  # Perform text classification on the input text
21
+ trans = tran_pipe(text)[0]
22
+ results = sentiment_pipeline(trans)[0]
23
+
24
  # Display the classification result
25
  max_score = float('-inf')
26
  max_label = ''