MarieAngeA13
commited on
Commit
•
23860a1
1
Parent(s):
fbdc6f1
Update README.md
Browse files
README.md
CHANGED
@@ -10,43 +10,30 @@ tags:
|
|
10 |
pipeline_tag: text-classification
|
11 |
---
|
12 |
|
13 |
-
Sentiment Analysis
|
14 |
-
This model
|
|
|
|
|
15 |
|
16 |
-
|
17 |
-
|
|
|
18 |
|
19 |
-
|
20 |
-
The model
|
21 |
-
The ratings were converted to sentiment labels as follows:
|
22 |
|
23 |
-
|
24 |
-
|
25 |
-
Ratings of 4 and 5 were labelled as 'Positive'
|
26 |
-
The text of each review was preprocessed by lowercasing, removing punctuation, emojis, and stop words, and tokenized with the BERT tokenizer.
|
27 |
-
|
28 |
-
The model was trained with a learning rate of 2e-5, an epsilon of 1e-8, and a batch size of 6 for 5 epochs.
|
29 |
-
|
30 |
-
Evaluation
|
31 |
-
The model was evaluated using a weighted F1 score.
|
32 |
|
33 |
Usage
|
34 |
-
To use
|
35 |
-
|
36 |
-
|
37 |
-
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
38 |
-
|
39 |
-
tokenizer = AutoTokenizer.from_pretrained("<Group209>")
|
40 |
-
model = AutoModelForSequenceClassification.from_pretrained("<Group209>")
|
41 |
|
42 |
-
|
43 |
|
44 |
-
|
45 |
-
output = model(**encoded_input)
|
46 |
-
predictions = output.logits.argmax(dim=1)
|
47 |
|
48 |
-
|
|
|
49 |
|
50 |
-
|
51 |
-
|
52 |
-
Furthermore, it might be biased towards certain phrases or words that are commonly used in the training dataset.
|
|
|
10 |
pipeline_tag: text-classification
|
11 |
---
|
12 |
|
13 |
+
User Comment Sentiment Analysis
|
14 |
+
This model aims to analyze user comments on products and extracting the expressed sentiments.
|
15 |
+
User ratings on the internet do not always provide detailed qualitative information about their experience.
|
16 |
+
Therefore, it is important to go beyond these ratings and extract more insightful information that can help a brand improve their product or service.
|
17 |
|
18 |
+
Objective
|
19 |
+
The model utilizes the BERT architecture and is trained on a dataset of user comments with sentiment labels.
|
20 |
+
The model is capable of analyzing comments and extracting sentiments such as positive, negative, or neutral.
|
21 |
|
22 |
+
Features
|
23 |
+
Sentiment Classification: The model can classify user comments into positive, negative, or neutral sentiments, providing an overall indication of the expressed opinion.
|
|
|
24 |
|
25 |
+
Improvement Suggestions: In cases where a comment expresses a negative or neutral sentiment, the model suggests an improved version of the text with a more positive sentiment.
|
26 |
+
This can help businesses understand consumer reactions and identify areas for product or service improvement.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
Usage
|
29 |
+
To use this sentiment analysis system, follow these steps:
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
|
31 |
+
Install the required dependencies by running the command pip install -r requirements.txt.
|
32 |
|
33 |
+
Once the training is complete, the best-trained model will be saved in the best_model_state.bin file.
|
|
|
|
|
34 |
|
35 |
+
To make predictions on new comments, use the analyze_sentiment(comment_text) function, replacing comment_text with the actual comment text to analyze.
|
36 |
+
The model will return the sentiment expressed in the comment.
|
37 |
|
38 |
+
To suggest an improved version of a comment, use the suggest_improved_text(comment_text) function.
|
39 |
+
If the comment expresses a negative or neutral sentiment, the function will generate an improved version of the text with a more positive sentiment. Otherwise, the original text will be returned without modification.
|
|