Implementation of SiameseCBOW using python3.4, keras and tensorflow.
- Mac OS 10.10.5
- python 3.4.3
- Keras 2.1.2
- tensorflow 1.4.0
$ pip install -r requirements.txt
At first, you should customize src/load.py so that you can load your data and preprocess it.
If you just want to test the codes, please comment out x, y = load(file)
and set variable:x, y in main.py like this:
def main():
...
import numpy as np
x = [np.ones((10, input_length))] * (1 + n_positive + n_negative)
y = np.ones((10, n_positive + n_negative))
...
model.fit(x, y, epochs=1)
If you want, please set Hyper-parameters such as embedding dimension in main.py.
Please execute this command at the git project directory:
$ python main.py -f <data_path>
and a pickle file of an embedding vector will be saved in ./save/
.