This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# FR = French | |
# PT = Portuguese | |
cycles = 3 | |
runs = [ | |
Run(desc='Test pre-trained model on FR', | |
lang='fr', output_dir=output_dir, validation_file="data/fr/fr_val.txt", test_file="data/fr/fr_test.txt"), | |
Run(desc='Test pre-trained model on PT', | |
lang='pt', output_dir=output_dir, validation_file="data/pt/pt_val.txt", test_file="data/pt/pt_test.txt"), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import string | |
from itertools import chain, islice | |
import datrie # type: ignore | |
class KBTrie: | |
""" | |
Knowledge Base with a Trie structure. | |
Does consecutive n-gram decomposition of a text and then uses the Trie to look-up. |