Spaces:
Sleeping
Sleeping
ErenKontas
commited on
Upload 6 files
Browse files- Derin Öğrenme Classificion ile Tweet Duygu Analizi - Twitter Sentiment Analysis with Deep Learning Classification.ipynb +0 -0
- Tweet.pkl +3 -0
- app.py +52 -0
- requirements.txt +4 -0
- test.csv +0 -0
- train.csv +0 -0
Derin Öğrenme Classificion ile Tweet Duygu Analizi - Twitter Sentiment Analysis with Deep Learning Classification.ipynb
ADDED
The diff for this file is too large to render.
See raw diff
|
|
Tweet.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:099b4b93265c576c3f5e07746fae41c2951828e911575dc83e0a480c6d0eb739
|
3 |
+
size 63270657
|
app.py
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import pandas as pd
|
2 |
+
import streamlit as st
|
3 |
+
import joblib
|
4 |
+
|
5 |
+
from sklearn.preprocessing import StandardScaler, OneHotEncoder
|
6 |
+
from sklearn.model_selection import train_test_split
|
7 |
+
from sklearn.compose import ColumnTransformer
|
8 |
+
|
9 |
+
# Veriyi yükleme ve sütun isimlerini güncelleme
|
10 |
+
df = pd.read_csv('train.csv')
|
11 |
+
|
12 |
+
# Bağımlı ve bağımsız değişkenlerin seçimi
|
13 |
+
x = df.drop(['essay_id', 'text'], axis=1)
|
14 |
+
y = df[['text']]
|
15 |
+
|
16 |
+
# Eğitim ve test verilerini ayırma
|
17 |
+
x_train, x_test, y_train, y_test = train_test_split(x, y, test_size=0.20, random_state=42)
|
18 |
+
|
19 |
+
# Ön işleme (StandardScaler ve OneHotEncoder)
|
20 |
+
preprocessor = ColumnTransformer(
|
21 |
+
transformers=[
|
22 |
+
('num', StandardScaler(), ['feeling']),
|
23 |
+
('cat', OneHotEncoder(), ['text'])
|
24 |
+
]
|
25 |
+
)
|
26 |
+
|
27 |
+
# Streamlit uygulaması
|
28 |
+
def rings_pred(feeling, text):
|
29 |
+
input_data = pd.DataFrame({
|
30 |
+
'text': [text],
|
31 |
+
'feeling': [feeling]
|
32 |
+
|
33 |
+
})
|
34 |
+
|
35 |
+
|
36 |
+
input_data_transformed = preprocessor.fit_transform(input_data)
|
37 |
+
|
38 |
+
model = joblib.load('Tweet.pkl')
|
39 |
+
|
40 |
+
prediction = model.predict(input_data_transformed)
|
41 |
+
return float(prediction[0])
|
42 |
+
|
43 |
+
st.title("Abalone Veri seti ile Yaş Tahmini Regresyon Modeli")
|
44 |
+
st.write("Veri Gir")
|
45 |
+
|
46 |
+
text = st.selectbox('text', df['text'].unique())
|
47 |
+
feeling = st.selectbox('feeling', df['feeling'].unique())
|
48 |
+
|
49 |
+
|
50 |
+
if st.button('Predict'):
|
51 |
+
rings = rings_pred(text,feeling)
|
52 |
+
st.write(f'The predicted rings is: {rings:.2f}')
|
requirements.txt
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
streamlit
|
2 |
+
scikit-learn
|
3 |
+
pandas
|
4 |
+
tensorflow
|
test.csv
ADDED
The diff for this file is too large to render.
See raw diff
|
|
train.csv
ADDED
The diff for this file is too large to render.
See raw diff
|
|