File size: 1,925 Bytes
c7f070d
 
 
 
 
 
 
 
 
 
 
 
 
f2dad69
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
---
title: Covid Sentiment Anlaysis With Streamlit
emoji: 🏢
colorFrom: gray
colorTo: pink
sdk: streamlit
sdk_version: 1.28.2
app_file: app.py
pinned: false
license: mit
---

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference



---

# Sentiment Analysis for Covid Feelings using Transformers and Streamlit

This Python script performs sentiment analysis using pre-trained transformer models from the `transformers` library and integrates it into a Streamlit app to analyze sentiments related to Covid feelings.

## Installation

### Requirements
- Python 3.x
- Required libraries: `transformers`, `datasets`, `streamlit`

Install necessary libraries by running:

```bash
pip install -q transformers datasets streamlit
```

## Usage

1. Clone or download the script.
2. Ensure Python and required libraries are installed.
3. Run the script in a Python environment.

The script showcases sentiment analysis using a pre-trained model (`avichr/heBERT_sentiment_analysis`) to classify the sentiment of input text into `Negative`, `Neutral`, or `Positive` categories related to Covid feelings.

### Steps:
1. Preprocesses the input text by handling placeholders for usernames and links.
2. Utilizes a pre-trained model (`bert-base-cased`) and the specified sentiment analysis model (`avichr/heBERT_sentiment_analysis`).
3. Calculates sentiment scores using softmax probabilities for each sentiment category.
4. Displays sentiment scores in a Streamlit app based on user input.

## Additional Information

- The script offers sentiment analysis functionality for Covid-related text input via a Streamlit interface.
- Ensure access to the specified model (`avichr/heBERT_sentiment_analysis`) before running the script.
- Users can interact with the Streamlit app by entering text related to Covid feelings to receive sentiment scores for Negative, Neutral, and Positive categories.