https://github.com/fahdseddik/company-sentiment-analysis
Streamlit app for company sentiment analysis based on tweets.
https://github.com/fahdseddik/company-sentiment-analysis
huggingface nlp sentiment-analysis streamlit
Last synced: about 2 months ago
JSON representation
Streamlit app for company sentiment analysis based on tweets.
- Host: GitHub
- URL: https://github.com/fahdseddik/company-sentiment-analysis
- Owner: FahdSeddik
- Created: 2022-09-20T22:04:29.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T12:16:00.000Z (over 3 years ago)
- Last Synced: 2025-07-20T02:12:46.441Z (12 months ago)
- Topics: huggingface, nlp, sentiment-analysis, streamlit
- Language: Python
- Homepage:
- Size: 43.9 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

# Company-Sentiment-Analysis
This is a Streamlit app for sentiment analysis that uses [XLM RoBERTa](https://huggingface.co/akhooli/xlm-r-large-arabic-sent) model on Hugging Face. The program scrapes twitter for tweets that are about a certain company.
The tweets are then fed into a model for sentiment analysis.
* You can find our CUSTOM MODEL in this repo [here](https://github.com/FahdSeddik/EgyptionCompaniesReviews_Sentiment_analysis)
# Interface
Below is a video demo of the app.
https://user-images.githubusercontent.com/62207434/192290351-86ad659d-ffcf-4e9a-bcec-2c01dc6119a0.mp4
# Installation
To be able to use this app, please follow the instructions below. First, you need to install requirements using the following command.
```bash
pip install -r requirements.txt
```
After that, you need to download this model from [Hugging Face](https://huggingface.co/akhooli/xlm-r-large-arabic-sent).
```python
from transformers import pipeline
import tokenizers
# this will download 2 GB
nlp = pipeline("sentiment-analysis", model='akhooli/xlm-r-large-arabic-sent')
# Save it in the same app folder
# .save_pretrained(path)
# 'XLM-R-L-ARABIC-SENT' is the folder name of the model
nlp.save_pretrained('XLM-R-L-ARABIC-SENT')
```
This will produce a folder that has the model. ***Please include the folder in the same directory as 'app.py'.***
In case you want to replace this model with another, you want to download your model and edit the `setup_model()` function. Implementation is shown below.
```python
def setup_model():
"""
Setup Model
"""
#*************************************************
# -==EDIT THE LINE BELOW WITH YOUR OWN MODEL==-
#*************************************************
nlp = pipeline("sentiment-analysis", model='XLM-R-L-ARABIC-SENT')
return nlp
```
Now to run the app, just simply run the command below in a terminal.
```bash
streamlit run app.py
```
# How to use?
Below you can find all the settings you can tweak that are related to your query.
If the program was unable to find enough tweets for a given query then the message below will show.

**WordCloud is not available for Arabic due to the library not being compatable with Arabic.**
# About
This Streamlit app was developed as part of my Data Scientist intern position at Banque Misr.