MAli7319 commited on
Commit
c0bbee8
·
1 Parent(s): c42a6d5

Update comment_analyzer.py

Browse files
Files changed (1) hide show
  1. comment_analyzer.py +11 -9
comment_analyzer.py CHANGED
@@ -1,11 +1,8 @@
1
  import gradio as gr
2
  import pandas as pd
3
- import numpy as np
4
- from langdetect import detect
5
  from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
6
  from sklearn.model_selection import train_test_split
7
  from sklearn.svm import SVR
8
- from sklearn.metrics import mean_squared_error
9
 
10
 
11
  data = pd.read_csv("modeled_data.csv")
@@ -20,9 +17,6 @@ def sample_model(df, regressor):
20
 
21
  model = regressor
22
  model.fit(X_train, y_train)
23
- y_pred = model.predict(X_test)
24
-
25
- rmse = np.sqrt(mean_squared_error(y_test, y_pred))
26
 
27
  return model
28
 
@@ -67,9 +61,17 @@ with gr.Blocks() as demo:
67
  compscore = gr.Number(label="Compound Score")
68
 
69
  gr.Examples(
70
- [["Totally enjoyed this course. Learnt whole new dimension of data science and its attributes"],
71
- ["The bad part of the course is that it doesn't get a person into the logics of some things right away or even doesn't get into them at all."],
72
- ["Not for the beginners very difficult to understand i gain nothing from this course i watch videos again and again but nothing fits in my mind"]],
 
 
 
 
 
 
 
 
73
  [input_comment],
74
  [[negscore, neuscore, posscore, compscore, rating]],
75
  fn=take_input
 
1
  import gradio as gr
2
  import pandas as pd
 
 
3
  from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
4
  from sklearn.model_selection import train_test_split
5
  from sklearn.svm import SVR
 
6
 
7
 
8
  data = pd.read_csv("modeled_data.csv")
 
17
 
18
  model = regressor
19
  model.fit(X_train, y_train)
 
 
 
20
 
21
  return model
22
 
 
61
  compscore = gr.Number(label="Compound Score")
62
 
63
  gr.Examples(
64
+ [["Not really a basic course. Goes too fast and sometimes the explanations aren't clear. The solutions to the exercises are not explained, and should be. Not much better than the other course I started and didn't finish.(3)"],
65
+ ["Presentation style was bad. Too much detail on the simpler topics, and glossed over some of the more complicated ones.(2)"],
66
+ ["This course is the worst Course i have ever watched (1)"],
67
+ ["The course is really great! The didatic in explain all concepts and pratical examples are amazing. Better than brazilian universities.(4)"],
68
+ ["The best!!!!!!!!!!(5)"],
69
+ ["Excelent description and view. The exercises were prepared very carefully. I suggest it.(5)"],
70
+ ["Yes, This course is a very good way to update/ refresh statistical knowledge (2)"],
71
+ ["explaination is good but practical examples are not so good (2.5)"],
72
+ ["Thanks for content. Good to know and understand the things easily. (3.5)"],
73
+ ["good (3)"],
74
+ ["The course navigation is very bad ..It is very tedious to navigate the course.(5)"]],
75
  [input_comment],
76
  [[negscore, neuscore, posscore, compscore, rating]],
77
  fn=take_input