MarieAngeA13 commited on
Commit
23860a1
1 Parent(s): fbdc6f1

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +18 -31
README.md CHANGED
@@ -10,43 +10,30 @@ tags:
10
  pipeline_tag: text-classification
11
  ---
12
 
13
- Sentiment Analysis Model for Hotel Reviews
14
- This model performs sentiment analysis on hotel reviews. The goal is to classify reviews into one of the three categories: Negative, Neutral, or Positive.
 
 
15
 
16
- Model Description
17
- This model is based on the BERT (Bidirectional Encoder Representations from Transformers) model, specifically bert-base-uncased.
 
18
 
19
- Training Procedure
20
- The model was trained on the TripAdvisor hotel reviews dataset. Each review in the dataset is associated with a rating from 1 to 5.
21
- The ratings were converted to sentiment labels as follows:
22
 
23
- Ratings of 1 and 2 were labelled as 'Negative'
24
- Rating of 3 was labelled as 'Neutral'
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 the model, load it and use it to classify a review. For example:
35
-
36
-
37
- from transformers import AutoTokenizer, AutoModelForSequenceClassification
38
-
39
- tokenizer = AutoTokenizer.from_pretrained("<Group209>")
40
- model = AutoModelForSequenceClassification.from_pretrained("<Group209>")
41
 
42
- text = "The hotel was great and the staff were very friendly."
43
 
44
- encoded_input = tokenizer(text, truncation=True, padding=True, return_tensors='pt')
45
- output = model(**encoded_input)
46
- predictions = output.logits.argmax(dim=1)
47
 
48
- print(predictions)
 
49
 
50
- Limitations and Bias
51
- The model is trained on English data, so it might not perform well on reviews in other languages.
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.