Skip to content

Commit 538cc01

Browse files
committed
Add comments and requirements file
1 parent efede91 commit 538cc01

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-6
lines changed

README.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Text Classification through a LSTM-based model
1+
# Text Classification through a LSTMs based model
22

3-
The aim of this repository is to show a baseline model for text classification by implementing a LSTM-based model coded in PyTorch. In order to provide a better understanding of the model, it will be used a dataset of Tweets provided by Kaggle.
3+
The aim of this repository is to show a baseline model for text classification by implementing a LSTM-based model coded in PyTorch. In order to provide a better understanding of the model, it will be used a Tweets dataset provided by <a href="https://www.kaggle.com/c/nlp-getting-started">Kaggle</a>
44

55
## 1. Data
66
As it was mentioned above, the implemented dataset is about Tweets regarding fake news. The ``raw``dataset contains some unnecessary columns which are going to be removed in the preprocessing step, in the end, we will be working with a dataset with a head such as this:
@@ -20,9 +20,16 @@ As it was already commented, the aim of this repository is to provide a base lin
2020
<img src='img/model_architecture.png'>
2121
</p>
2222

23-
## 3. Install dependencies
24-
Working on
25-
23+
## 3. Dependencies
24+
This model was developed under these specified versions:
25+
```
26+
torch==1.0.1.post2
27+
torchtext==0.6.0
28+
tensorflow==1.12.0
29+
Keras==2.0.0
30+
numpy==1.15.4
31+
pandas==1.0.3
32+
```
2633
## 4. How to use it
2734
The model can be executed easily by typing:
2835
```
@@ -57,4 +64,9 @@ Epoch: 10, loss: 0.01348, Train accuracy: 0.92808, Test accuracy: 0.75378
5764
So the learning curves will look like:
5865
<p align="center">
5966
<img src='img/performance.svg'>
60-
</p>
67+
</p>
68+
69+
## 6. Future work
70+
As it was mentioned, the aim of this repository is to provdie a base line for the text classification task. It's important to mention that, the problem of text classifications goes beyond than a two-stacked LSTM architecture where texts are preprocessed under tokens-based methodology. Recent works have shown impressive results by implemeting transformers based architectures (e.g. <a href="https://jalammar.github.io/a-visual-guide-to-using-bert-for-the-first-time/"> BERT</a>). Nevertheless, by following this thread, this proposed model can be improved by removing the tokens-based methodology and implementing a word embeddings based model instead (e.g. <a href="https://radimrehurek.com/gensim/models/word2vec.html">word2vec-gensim</a>). Likewise, bi-directional LSTMs can be applied in order to catch more context (in a forward and backward way).
71+
72+
<i>The question remains open: how to learn semantics? what is semantics? would DL-based are capable to learn semantics?</i>

requirements.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
torch==1.0.1.post2
2+
torchtext==0.6.0
3+
tensorflow==1.12.0
4+
Keras==2.0.0
5+
numpy==1.15.4
6+
pandas==1.0.3

0 commit comments

Comments
 (0)