Skip to content

Commit 75dc5e2

Browse files
committed
fixed validation loop
1 parent 2399b57 commit 75dc5e2

File tree

5 files changed

+275
-728
lines changed

5 files changed

+275
-728
lines changed

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.ipynb_checkpoints/
22
__pycache__/
33
saved_models/
4+
*.ipynb
45
*.pt

Diff for: README.md

+25-28
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,40 @@
1-
# Zero-shot User Intent Detection via Capsule Neural Networks (PyTorch Implementation)
1+
# GPU-accelerated PyTorch implementation of Zero-shot User Intent Detection via Capsule Neural Networks
22

3-
This repository implements a capsule model named IntentCapsNet-ZSL on the SNIPS-NLU dataset with PyTorch (extension of Tensorflow version)
3+
This repository implements a capsule model IntentCapsNet-ZSL on the SNIPS-NLU dataset in Python 3
4+
with PyTorch, first introduced in the paper _Zero-shot User Intent Detection via Capsule Neural Networks_.
45

5-
The official Tensorflow version is available:
6-
https://github.com/congyingxia/ZeroShotCapsule
6+
The code aims to follow PyTorch best practices, using `torch` instead of `numpy` where possible, and using
7+
`.cuda()` for GPU computation. Feel free to contribute via pull requests.
78

8-
Please see the following paper for the details:
9-
10-
Congying Xia*, Chenwei Zhang*, Xiaohui Yan, Yi Chang, Philip S. Yu. Zero-shot User
11-
Intent Detection via Capsule Neural Networks. In Proceedings of the 2018 Conference on
12-
Empirical Methods in Natural Language Processing (EMNLP), 2018. (* equally contributed)
9+
# Requirements
1310

14-
https://arxiv.org/abs/1809.00385
11+
python 3.6+
1512

13+
torch 1.0.1
1614

15+
numpy
1716

18-
# Requirements
17+
gensim
1918

20-
Python 2.7.12
19+
scikit-learn
2120

22-
torch 1.0.1
21+
# Usage and Modification
2322

24-
Numpy
23+
* To run the training-validation loop: `python run.py`.
24+
* The custom `Dataset` class is implemented in `dataset.py`.
2525

26-
Gensim
26+
# Acknowledgements
27+
* Original repository (TensorFlow, Python 2): https://github.com/congyingxia/ZeroShotCapsule
28+
* Re-implementation (PyTorch, Python 2): https://github.com/nhhoang96/ZeroShotCapsule-PyTorch-
2729

28-
Sklearn
30+
Please see the following paper for the details:
2931

30-
# Usage
32+
Congying Xia, Chenwei Zhang, Xiaohui Yan, Yi Chang, Philip S. Yu. Zero-shot User
33+
Intent Detection via Capsule Neural Networks. In Proceedings of the 2018 Conference on
34+
Empirical Methods in Natural Language Processing (EMNLP), 2018.
3135

32-
```
33-
python main.py
34-
```
36+
https://arxiv.org/abs/1809.00385
3537

36-
If you find the code useful, please cite the paper.
3738

3839
```
3940
@article{xia2018zero,
@@ -43,11 +44,7 @@ If you find the code useful, please cite the paper.
4344
year={2018}
4445
}
4546
```
46-
47-
# Acknowledgements
48-
https://github.com/congyingxia/ZeroShotCapsule
49-
50-
https://github.com/soskek/dynamic_routing_between_capsules
51-
52-
https://github.com/ExplorerFreda/Structured-Self-Attentive-Sentence-Embedding
47+
# References
48+
* https://github.com/soskek/dynamic_routing_between_capsules
49+
* https://github.com/ExplorerFreda/Structured-Self-Attentive-Sentence-Embedding
5350

0 commit comments

Comments
 (0)