Update nlp.vectors to nlp.vocab.vectors (#5357)

This commit is contained in:
adrianeboyd 2020-04-27 10:53:05 +02:00 committed by GitHub
parent fc91660aa2
commit 90c754024f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -111,7 +111,7 @@ Check whether a key has been mapped to a vector entry in the table.
> >
> ```python > ```python
> cat_id = nlp.vocab.strings["cat"] > cat_id = nlp.vocab.strings["cat"]
> nlp.vectors.add(cat_id, numpy.random.uniform(-1, 1, (300,))) > nlp.vocab.vectors.add(cat_id, numpy.random.uniform(-1, 1, (300,)))
> assert cat_id in vectors > assert cat_id in vectors
> ``` > ```
@ -315,7 +315,7 @@ performed in chunks, to avoid consuming too much memory. You can set the
> >
> ```python > ```python
> queries = numpy.asarray([numpy.random.uniform(-1, 1, (300,))]) > queries = numpy.asarray([numpy.random.uniform(-1, 1, (300,))])
> most_similar = nlp.vectors.most_similar(queries, n=10) > most_similar = nlp.vocab.vectors.most_similar(queries, n=10)
> ``` > ```
| Name | Type | Description | | Name | Type | Description |