How ibrahimsharaf/doc2vec works
This repository is a Doc2Vec-based binary sentiment classifier for IMDB reviews. Running text_classifier.py loads the tab-separated dataset, splits and labels reviews, trains document embeddings and a logistic-regression classifier, then evaluates predictions with classification metrics. The graph separates data preparation, embedding, classification, and orchestration. The README describes the overall workflow; the sampled source shows the implementation. The classifiers/ directory is empty in the provided tree, so no model persistence is shown.
Main entry points: text_classifier.py TextClassifier · classifier_model.py Logistic regression · doc2vec_model.py Doc2Vec model · model.py Model abstraction
Components 9
Workflow
- Script entry point
text_classifier.py - TextClassifier
text_classifier.py - Model abstraction
models/model.py
Review data
- Split and label
text_classifier.py - IMDB reviews
data/dataset.csv
Document embeddings
- Doc2Vec model
models/doc2vec_model.py
Classification
- Logistic regression
models/classifier_model.py - Metrics evaluation
models/classifier_model.py
Other components
- User
Connections 14
- User → Script entry point: runs
- Script entry point → TextClassifier: creates
- Script entry point → TextClassifier: starts
- TextClassifier → IMDB reviews: reads
- TextClassifier → Split and label: splits and labels
- Split and label → Doc2Vec model: labels reviews
- TextClassifier → Doc2Vec model: initializes and trains
- TextClassifier → Logistic regression: initializes and trains
- Logistic regression → Doc2Vec model: gets vectors
- TextClassifier → Logistic regression: tests model
- Logistic regression → Doc2Vec model: gets test vectors
- Logistic regression → Metrics evaluation: computes metrics
- Logistic regression → Model abstraction: extends
- Doc2Vec model → Model abstraction: extends