# doc2vec
A simple and readable implementation of doc2vec [1], using Python 3, Keras and TensorFlow.
## Installation
```
pip install -r requirements.txt
python setup.py install
```
## Assumptions
This implementation assumes that your documents are all in the same directory,
and named with monotonically incrementing integer IDs, e.g. `0.txt`, `1.txt`.
Each file should contain an ordinary text document, i.e. without any special
preprocessing.
## Usage
```
doc2vec path/to/docs/ \
--save path/to/save/model.hdf5 \
--save_vocab path/to/save/vocab.vocab \
--train
```
By default, this will use the Distributed Memory (DM) model. You can also use
the Distributed Bag-Of-Words (DBOW) model with:
```
doc2vec path/to/docs/ --model dbow
```
Previously trained models can be loaded with:
```
doc2vec path/to/docs/ \
--load path/to/load/model.hdf5 \
--load_vocab path/to/load/vocab.vocab
```
And document embeddings can be written to file as follows:
```
doc2vec path/to/docs/ \
--load path/to/load/model.hdf5 \
--load_vocab path/to/load/vocab.vocab \
--save_doc_embeddings path/to/save/embeddings.hdf5
```
Finally, you can see all available options and model parameters with:
```
doc2vec -h
```
## References
1. Le, Quoc, and Mikolov, Tomas. "Distributed representations of sentences and
documents." International Conference on Machine Learning. 2014.
2. Bird, Steven, Loper, Edward and Klein, Ewan. "Natural Language
Processing with Python." O’Reilly Media Inc. 2009.

素寰韶
- 粉丝: 31
最新资源
- 路径规划领域中跳点搜索算法及其改进版本的技术解析与应用
- DSP驱动的数字电源系统:基于C2000主控的300W Buck-Boost双向变换器设计方案与实现
- COMSOL光学模拟:高斯光束通过偏振棱镜与反射面后的光强质心偏移研究 (07月28日)
- 工业自动化中WINCC系统的水电气能源报表自动化管理及应用
- 格子玻尔兹曼LBM D3Q19方法在多孔介质渗流场求解与可视化的应用研究 · D3Q19 完整版
- 基于Simulink的永磁同步电机滑模观测器无位置传感器控制仿真模型研究
- 基于Matlab的指纹识别系统设计:从特征提取到GUI实现
- VB工业自动化项目:27轴混合驱动与精准喷胶系统的实现及应用
- 电力系统仿真中变压器励磁涌流的Python建模与分析 Python
- PLC1200与Factory IO联机仿真的模拟工厂设计及其实现方法 · PLC编程
- 永磁同步电机PMSM负载状态估计与MATLABSimulink仿真模型研究
- 永磁同步电机PMSM的5+7次谐波注入与死区补偿技术:降低转矩脉动及电压补偿的PPT与Simulink模型说明
- Comsol燃料电池模型:等温和不等温仿真的研究与应用
- 永磁同步电机全速域无位置传感器控制的仿真研究:采用高频注入改进滑膜控制方法及PMSM矢量控制仿真 高频注入 高级版
- 基于灰狼优化算法的光伏MPPT控制策略:局部遮阴环境下的阴影动态与应对措施
- 离线DP动态规划节能速度规划与Carsim联合仿真验证:电动汽车高效能解决方案 - 动态规划
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈



评论0