<commit_before>import logging
import unittest
import vsmlib
import vsmlib.benchmarks
import vsmlib.benchmarks.analogy
import vsmlib.benchmarks.analogy.analogy

logging.basicConfig(level=logging.DEBUG)


class Tests(unittest.TestCase):

    def test_3cosadd(self):
        path_model = "./test/data/embeddings/text/plain_no_file_header"
        model = vsmlib.model.load_from_dir(path_model)
        vsmlib.benchmarks.analogy.analogy.options["dir_root_dataset"] = "./test/data/benchmarks/analogy/"
        vsmlib.benchmarks.analogy.analogy.options["path_results"] = "/tmp/vsmlib/analogy"
        vsmlib.benchmarks.analogy.analogy.options["name_method"] = "CosAdd"
        vsmlib.benchmarks.analogy.analogy.m = model  # todo this is ugly and should be fixed
        vsmlib.benchmarks.analogy.analogy.run_all("benchmarks")

    def test_3cosavg(self):
        path_model = "./test/data/embeddings/text/plain_no_file_header"
        model = vsmlib.model.load_from_dir(path_model)
        vsmlib.benchmarks.analogy.analogy.options["dir_root_dataset"] = "./test/data/benchmarks/analogy/"
        vsmlib.benchmarks.analogy.analogy.options["path_results"] = "/tmp/vsmlib/analogy"
        vsmlib.benchmarks.analogy.analogy.options["name_method"] = "CosAvg"
        vsmlib.benchmarks.analogy.analogy.m = model<commit_msg>fixed a　is_pair_existing bug for CosAvg methods on analogy task<commit_after>import logging
import unittest
import vsmlib
import vsmlib.benchmarks
import vsmlib.benchmarks.analogy
import vsmlib.benchmarks.analogy.analogy

logging.basicConfig(level=logging.DEBUG)


class Tests(unittest.TestCase):

    def test_3cosadd(self):
        path_model = "./test/data/embeddings/text/plain_no_file_header"
        model = vsmlib.model.load_from_dir(path_model)
        vsmlib.benchmarks.analogy.analogy.options["dir_root_dataset"] = "./test/data/benchmarks/analogy/"
        vsmlib.benchmarks.analogy.analogy.options["path_results"] = "/tmp/vsmlib/analogy"
        vsmlib.benchmarks.analogy.analogy.m = model  # todo this is ugly and should be fixed
        vsmlib.benchmarks.analogy.analogy.run_all("benchmarks")

    def test_3cosavg(self):
        path_model = "./test/data/embeddings/text/plain_no_file_header"
        model = vsmlib.model.load_from_dir(path_model)
        vsmlib.benchmarks.analogy.analogy.options["dir_root_dataset"] = "./test/data/benchmarks/analogy/"
        vsmlib.benchmarks.analogy.analogy.options["path_results"] = "/tmp/vsmlib/analogy"
        vsmlib.benchmarks.analogy.analogy.options["name_method"] = "3CosAvg"
        vsmlib.benchmarks.analogy.analogy.m = model
{'fraction_non_alphanumeric': 0.11513284559106661, 'fraction_numerical': 0.0019252984212552945, 'mean_word_length': 4.025145067698259, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2062255', 'n_tokens_mistral': 882, 'n_tokens_neox': 871, 'n_words': 110}