change model and change for segmented data
Browse files- app.py +3 -0
- requirements.txt +2 -1
- train/model/gru_model.h5 +2 -2
- train/model/lstm_model.h5 +2 -2
- train/tokenizer/tokenizer.pkl +2 -2
app.py
CHANGED
|
@@ -10,6 +10,8 @@ from pathlib import Path
|
|
| 10 |
import pandas as pd
|
| 11 |
import plotly.express as px
|
| 12 |
|
|
|
|
|
|
|
| 13 |
#Load tokenizer
|
| 14 |
#fp = Path(__file__).with_name('tokenizer.pkl')
|
| 15 |
with open('train/tokenizer/tokenizer.pkl',mode="rb") as f:
|
|
@@ -26,6 +28,7 @@ GRU_model = load_model('train/model/gru_model.h5')
|
|
| 26 |
|
| 27 |
def tokenizer_pad(tokenizer,comment_text,max_length=200):
|
| 28 |
|
|
|
|
| 29 |
comment_text = [comment_text]
|
| 30 |
tokenized_text = tokenizer.texts_to_sequences(comment_text)
|
| 31 |
|
|
|
|
| 10 |
import pandas as pd
|
| 11 |
import plotly.express as px
|
| 12 |
|
| 13 |
+
from underthesea import word_tokenize
|
| 14 |
+
|
| 15 |
#Load tokenizer
|
| 16 |
#fp = Path(__file__).with_name('tokenizer.pkl')
|
| 17 |
with open('train/tokenizer/tokenizer.pkl',mode="rb") as f:
|
|
|
|
| 28 |
|
| 29 |
def tokenizer_pad(tokenizer,comment_text,max_length=200):
|
| 30 |
|
| 31 |
+
comment_text = word_tokenize(comment_text, format="text")
|
| 32 |
comment_text = [comment_text]
|
| 33 |
tokenized_text = tokenizer.texts_to_sequences(comment_text)
|
| 34 |
|
requirements.txt
CHANGED
|
@@ -5,4 +5,5 @@ tensorflow
|
|
| 5 |
numpy
|
| 6 |
pathlib
|
| 7 |
plotly
|
| 8 |
-
pandas
|
|
|
|
|
|
| 5 |
numpy
|
| 6 |
pathlib
|
| 7 |
plotly
|
| 8 |
+
pandas
|
| 9 |
+
underthesea
|
train/model/gru_model.h5
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d5ec54a3ff4cdd458ab651ca05774eb7f4f7e744046def14e9d176755a1a142a
|
| 3 |
+
size 244995280
|
train/model/lstm_model.h5
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f53c0db54bb35ec3649093abb0d0df3e40406003b16d83dc075e0c69127e8ed3
|
| 3 |
+
size 243514400
|
train/tokenizer/tokenizer.pkl
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ddfc25d59703cbcb2d2267ff9a5ed142abf70bccd826b13b88952547308371ef
|
| 3 |
+
size 9146630
|