http://ai.stanford.edu/~amaas/data/sentiment/
- Python 3.6 >=
- Numpy
import data_loader or from . import data_loader
Note: import statement depends on your source root
Input
- train_dir_path: training directory path e.g. './aclImdb/train/'
- valid_rate: validation data rate (0 - 1), 0.1 by default
Output
- train_texts: training text list
- train_labels: training label array (numpy.ndarray, 0: negative, 1:positive)
- valid_texts: validation text list
- valid_labels: validation label array (numpy.ndarray, 0: negative, 1:positive)
Input
- test_dir_path: test directory path e.g. './aclImdb/test/'
Output
- test_texts: test text list
- test_labels: test label array (numpy.ndarray, 0: negative, 1:positive)
Input
- vocab_file_path: vocabulary file path e.g. './aclImdb/imdb.vocab'
Output
- vocab_dict: vocabulary dictionary (key: str, value: int)