Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /gradio-app_gradio /demo /sentiment_analysis /run.py
| import gradio as gr | |
| import nltk # type: ignore | |
| from nltk.sentiment.vader import SentimentIntensityAnalyzer # type: ignore | |
| nltk.download("vader_lexicon") | |
| sid = SentimentIntensityAnalyzer() | |
| def sentiment_analysis(text): | |
| scores = sid.polarity_scores(text) | |
| del scores["compound"] | |
| return scores | |
| demo = gr.Interface( | |
| fn=sentiment_analysis, | |
| inputs=gr.Textbox(placeholder="Enter a positive or negative sentence here..."), | |
| outputs="label", | |
| examples=[["This is wonderful!"]], | |
| api_name="predict") | |
| demo.launch() | |
Xet Storage Details
- Size:
- 538 Bytes
- Xet hash:
- d65fb785a49309842757e1d9bc1368d2095766b19050ced53f81d2d3c3f84c24
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.