YAMITEK commited on
Commit
1b85847
·
verified ·
1 Parent(s): 297d374

Upload 7 files

Browse files
.gitattributes CHANGED
@@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ ChatGPT_Reviews.csv filter=lfs diff=lfs merge=lfs -text
37
+ ChatGpt_Reviews.docx filter=lfs diff=lfs merge=lfs -text
ChatGPT_Reviews.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7e838ac76a7a83a8bbf807033501d4f737b476da0d10e0abe89ddb66ad660167
3
+ size 20716595
ChatGpt_Reviews.docx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:582656821cc8711ad065737d9d7df22f0eed12d575bf243d4fc85b84cdc816e2
3
+ size 1108696
Chat_GPT_Notebook (1).ipynb ADDED
The diff for this file is too large to render. See raw diff
 
app.py ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import pandas as pd
2
+ import numpy as np
3
+ import re
4
+ import streamlit as st
5
+ import joblib
6
+ import numpy as np
7
+ import pandas as pd
8
+
9
+
10
+ html_temp = """
11
+ <div style="background-color:black;padding:10px">
12
+ <h2 style="color:white;text-align:center;">Chat GPT Review Prediction </h2>
13
+ </div>
14
+ """
15
+ st.markdown(html_temp, unsafe_allow_html=True)
16
+
17
+ image_url="https://storage.googleapis.com/kaggle-datasets-images/6377125/10302664/91e3eb67027ab3122886b971613e7c2f/dataset-cover.jpg?t=2024-12-26-10-34-17"
18
+
19
+ st.image(image_url, use_container_width=True)
20
+
21
+
22
+
23
+ input_txt=st.text_input("Enter the Review")
24
+
25
+
26
+ # preprocess the text
27
+
28
+ def preprocess_text(text):
29
+ text = text.lower()
30
+ text = re.sub(r'\d+', '', text)
31
+ text = re.sub(r'[^\w\s]', '', text)
32
+ text = re.sub(r'\s+', ' ', text)
33
+
34
+ return text
35
+
36
+ # loading the models
37
+ loaded_tfidf = joblib.load("tfidf_model.joblib")
38
+ model = joblib.load("chat_review_model.joblib")
39
+
40
+ # processing
41
+ if input:
42
+ test=preprocess_text(input_txt)
43
+ label=loaded_tfidf.transform([test])
44
+
45
+ # predict and display
46
+ if st.button("Submit"):
47
+ predict=model.predict(label)[0]
48
+
49
+ if predict==1:
50
+ st.write("Its is a Good Review")
51
+
52
+ elif predict==0:
53
+ st.write("Its is a Bad Review")
54
+
chat_review_model.joblib ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:43920f392997bec00f0921aaf501ef5f6b8348265b21f5b49377d7186d8c703d
3
+ size 243946
requirements.txt ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ joblib==1.2.0
2
+ matplotlib==3.7.2
3
+ matplotlib-inline==0.1.6
4
+ numpy==1.24.4
5
+ pandas==2.2.2
6
+ scikit-learn==1.4.1.post1
7
+ streamlit==1.33.0
8
+ streamlit-chat==0.1.1
9
+ nltk==3.8.1
tfidf_model.joblib ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:900bf57884c008f008ef9a92d840eb275459c9a6110acb321a4b4b15c1829e56
3
+ size 1055889