dabbu2000 commited on
Commit
5f428ba
·
1 Parent(s): c603f7c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -13,7 +13,7 @@ sentimentAnalysisModels = {
13
  sentimentAnalysisLanguageSelections = st.selectbox("Please select one of these finetuned models from the dropdown", list(sentimentAnalysisModels.keys()))
14
 
15
  # roBERTa specific label map
16
- languageMapRoberta = {"LABEL_0": "NEGATIVE",
17
  "LABEL_1": "POSITIVE", "LABEL_2": "NEUTRAL"}
18
 
19
  # Load the selected model and tokenizer
@@ -30,7 +30,7 @@ sentimentAnalysisSubmitButton = st.button("Press the submit button for final gra
30
  if sentimentAnalysisSubmitButton and sentimentAnalysisTextInput:
31
  sentimentAnalysisFinalOutput = sentiment_pipeline(sentimentAnalysisTextInput)
32
  if sentimentAnalysisSelectedModels == "roBERTa":
33
- st.write("Roberta Sentiment Analysis Resultant Value:", roberta_label_map[result[0]["Roberta Label"]])
34
  st.write("Roberta Sentiment Analysis Resultant Score:", sentimentAnalysisFinalOutput[0]["Probability Assigned with Sentiment Analysis Label"])
35
  else:
36
  st.write("Sentiment Analysis Resultant Value:", sentimentAnalysisFinalOutput[0]["Sentiment Analysis Label"])
 
13
  sentimentAnalysisLanguageSelections = st.selectbox("Please select one of these finetuned models from the dropdown", list(sentimentAnalysisModels.keys()))
14
 
15
  # roBERTa specific label map
16
+ sentimentAnalysisLanguageMap = {"LABEL_0": "NEGATIVE",
17
  "LABEL_1": "POSITIVE", "LABEL_2": "NEUTRAL"}
18
 
19
  # Load the selected model and tokenizer
 
30
  if sentimentAnalysisSubmitButton and sentimentAnalysisTextInput:
31
  sentimentAnalysisFinalOutput = sentiment_pipeline(sentimentAnalysisTextInput)
32
  if sentimentAnalysisSelectedModels == "roBERTa":
33
+ st.write("Roberta Sentiment Analysis Resultant Value:", sentimentAnalysisLanguageMap[sentimentAnalysisFinalOutput[0]["Roberta Label"]])
34
  st.write("Roberta Sentiment Analysis Resultant Score:", sentimentAnalysisFinalOutput[0]["Probability Assigned with Sentiment Analysis Label"])
35
  else:
36
  st.write("Sentiment Analysis Resultant Value:", sentimentAnalysisFinalOutput[0]["Sentiment Analysis Label"])