santit96 commited on
Commit
18464de
·
1 Parent(s): 9ce25d8

Updated README with usage instructions and add streamlit as dependency

Browse files
Files changed (2) hide show
  1. README.md +26 -0
  2. requirements.txt +1 -0
README.md CHANGED
@@ -1 +1,27 @@
1
  # bert-sentiment-analysis
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  # bert-sentiment-analysis
2
+
3
+ Prototype that classifies text into positive or negative sentiments using a fine tuned bert model
4
+
5
+ ## Installation of dependencies
6
+
7
+ `pip install -r requirements.txt`
8
+
9
+ ## Usage
10
+
11
+ 1. Download the [trained model](https://drive.google.com/file/d/1yI1yEsAco-U-Ma9uDrJSQV21DnF2n1vU/view?usp=sharing) and move it to the *models* directory
12
+ 2. Use the tool:
13
+ * To use it as a **streamlit web app** run:
14
+
15
+ `streamlit run sentiment_analysis.py`
16
+
17
+ It will open a web app on `http://localhost:8501`
18
+
19
+ * To use it from **command line** run
20
+
21
+ `python sentiment_classificator.py <TEXT_TO_CLASSIFY>`
22
+
23
+ ## Training
24
+
25
+ 1. Download the [all_sentiment_dataset.csv](https://drive.google.com/file/d/175Ccd3B6kLWMBvr1WAUzQJT4TwgzXF6N/view?usp=sharing)
26
+ 2. Execute the *classify_sentiment_with_bert* notebook which is in the *notebooks* directory
27
+ 3. The model should be saved under *models* directory as **sentiments_bert_model.h5**
requirements.txt CHANGED
@@ -1,5 +1,6 @@
1
  pandas
2
  jupyter
3
  numpy
 
4
  tensorflow
5
  tensorflow-text
 
1
  pandas
2
  jupyter
3
  numpy
4
+ streamlit
5
  tensorflow
6
  tensorflow-text