title | tags | description |
---|---|---|
my IA Challenge |
django, keras |
View the slide with "Slide Mode". |
- I'm Python lover π
- Fullstack developer
- Linux user expert π§
I want to said. My expertise in IA, machine learning, deep learning, and neurons is very rusty.
π΄
vagrant@ubuntu-xenial:/vagrant$ cat data.json | tail -n 2 | jq
{
"count": 0,
"text": "lol",
"topics": [
{
"topic": 0,
"relevance": 32,
"confidence": 224
}
],
"player": "4446",
"flags": 4247631,
"client_id": 999,
"filtered": 0,
"simplified": "lol"
}
- Using keras
- Using django
- Obtain train data and test data.
- Define the best Keras Model for the case.
- Pass the train data to a Keras model compiled and then evaluate the test data.
- Check if train data works as expected
First, try
model = Sequential()
model.add(Dense(512, input_dim=vocab_size))
model.add(Activation('relu'))
model.add(Dense(9))
model.add(Activation('softmax'))
model.compile(loss='categorical_crossentropy',
optimizer='rmsprop',
metrics=['accuracy'])
Test score: 2.1609163373932803
Test accuracy: 38.34586441516876
Second try:
model = Sequential()
model.add(Dense(10, input_dim=vocab_size, activation="relu"))
model.add(Dense(len(num_tops), activation="sigmoid"))
## Compile the models
model.compile(loss='binary_crossentropy',
optimizer='adam',
metrics=['accuracy'])
Test score: 0.14842960193641203
Test accuracy: 96.06708884239197
π
check training =====
###
text: her asdvice
Actual topics: [0]
Predicted topics: [0] **YEAH!*
###
text: so they took lyk 3 pics
Actual topics: [0, 3, 4]
Predicted topics: [0] **YEAH!*
###
text: ohhhh
Actual topics: [0]
Predicted topics: [0] **YEAH!*
###
text: so i was like ARGHHH
Actual topics: [0]
Predicted topics: [0] **YEAH!*
###
text: dnt laf ab god
Actual topics: [0, 3, 11, 12]
Predicted topics: [0] **YEAH!*
π π π π π π
Text classification β
Next ?
let's do some Web development.
With:
- Django
- Celery
- django-restframework
- vuejs (parceljs)
Simple SPA for send new text and expect to use my new script to classify new text.
Demo time.
My Conclusion
- This challenge was FUN β
- With the better understanding about the models and compile options you can obtain a better results.
- I missing the unittest β