# How to use two .txt files one with vectors the other with words

**URL:** <https://support.prodi.gy/t/how-to-use-two-txt-files-one-with-vectors-the-other-with-words/565>\
**Category:** Uncategorized\
**Tags:** usage, spacy, solved\
**Created:** [May 25, 2018, 9:45pm UTC](https://support.prodi.gy/t/how-to-use-two-txt-files-one-with-vectors-the-other-with-words/565 "2018-05-25T21:45:32Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![ines](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/ines/32/3_2.png) [@ines](https://support.prodi.gy/u/ines)\
**Post date:** [May 26, 2018, 3:17pm UTC](https://support.prodi.gy/t/how-to-use-two-txt-files-one-with-vectors-the-other-with-words/565/4 "2018-05-26T15:17:02Z")

</div>

Hi! To answer your first question, creating a spaCy model with Word2Vec vectors should be as simple as this:

```python
for word in w2v.wv.vocab:
    nlp.vocab.set_vector(word, w2v.wv.word_vec(word))

```

(The source of the `terms.train-vectors` recipe is shipped with Prodigy, so you can also have a look at the code and see how the training plus creating a spaCy model works here).

> [@idealley](#):
>
> For testing puproses I have combined a few lines of both text files:
> 
> ```python
> <word><space><vector>
> 
> ```

The [`init-model` command](https://spacy.io/api/cli#init-model) expects a _tab-separated_ file in the Word2Vec format, where the first line is a string tuple of the shape. See [my comment here](https://github.com/explosion/spaCy/issues/2298#issuecomment-387091526) and [this post](https://stackoverflow.com/questions/27324292/convert-word2vec-bin-file-to-text/29251943#29251943) for more details on the format.

---

_[View the full topic](https://support.prodi.gy/t/how-to-use-two-txt-files-one-with-vectors-the-other-with-words/565)._
