vecto icon indicating copy to clipboard operation
vecto copied to clipboard

Unclear documentation and examples; how to evaluate embeddings on BATS?

Open gloryVine opened this issue 4 years ago • 1 comments

Hi,

I tried to follow the documentation on readthedocs, but the api there seems to be outdated. What I want to do is, evaluate my trained embeddings on the BATS analogy task. What I have so far is: created a directory dir with a .npy and a .vocab file, containing embeddings for a SUBSET of the words in BATS (I can't learn embeddings for all words in BATS, as the corpus I train doesn't contain all those words), and their corresponding names. I also created a folder for the original BATS dataset, which has subfolders like '1_Inflectional_morphology' that each contain the individual text files of that dataset.

I then did:

import vecto.embeddings
from vecto.benchmarks.analogy.analogy import Analogy

path_to_my_vsm_directory = 'path_to_dir'
model = vecto.embeddings.load_from_dir(path)

options = {}
options['path_dataset'] = 'path_to_BATS'
options["path_results"] = path_to_my_vsm_directory
options["name_method"] = '3CosAdd'

analogy = Analogy(model, options)

This generates no output. What am I supposed to do here? analogy.get_result() as described in 'vecto/examples/analogy.ipynb' gives: AttributeError: 'Analogy' object has no attribute 'get_result'.

gloryVine avatar Jul 09 '20 02:07 gloryVine

Same...

lfcc1 avatar Jun 09 '22 18:06 lfcc1