From 33b84f4c39dfea47d1f0908a58f400249a27d59d Mon Sep 17 00:00:00 2001 From: ines Date: Wed, 8 Nov 2017 18:11:23 +0100 Subject: [PATCH] Change clear_vectors to reset_vectors (resolves #1516) --- examples/vectors_fast_text.py | 2 +- website/api/vocab.jade | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/examples/vectors_fast_text.py b/examples/vectors_fast_text.py index 03999f24a..6d8bee0c0 100644 --- a/examples/vectors_fast_text.py +++ b/examples/vectors_fast_text.py @@ -18,7 +18,7 @@ def main(vectors_loc): with open(vectors_loc, 'rb') as file_: header = file_.readline() nr_row, nr_dim = header.split() - nlp.vocab.clear_vectors(int(nr_dim)) + nlp.vocab.reset_vectors(width=int(nr_dim)) for line in file_: line = line.decode('utf8') pieces = line.split() diff --git a/website/api/vocab.jade b/website/api/vocab.jade index 54dd4f691..0e3d1b5e2 100644 --- a/website/api/vocab.jade +++ b/website/api/vocab.jade @@ -162,24 +162,29 @@ p +cell int +cell The integer ID by which the flag value can be checked. -+h(2, "clear_vectors") Vocab.clear_vectors ++h(2, "reset_vectors") Vocab.reset_vectors +tag method +tag-new(2) p | Drop the current vector table. Because all vectors must be the same - | width, you have to call this to change the size of the vectors. + | width, you have to call this to change the size of the vectors. Only + | one of the #[code width] and #[code shape] keyword arguments can be + | specified. +aside-code("Example"). - nlp.vocab.clear_vectors(new_dim=300) + nlp.vocab.reset_vectors(width=300) +table(["Name", "Type", "Description"]) +row - +cell #[code new_dim] + +cell #[code width] +cell int - +cell - | Number of dimensions of the new vectors. If #[code None], size - | is not changed. + +cell The new width (keyword argument only). + + +row + +cell #[code shape] + +cell int + +cell The new shape (keyword argument only). +h(2, "prune_vectors") Vocab.prune_vectors +tag method