Skip to content

Instantly share code, notes, and snippets.

View cpcdoy's full-sized avatar
🙃

cpcdoy

🙃
View GitHub Profile
@cpcdoy
cpcdoy / train_cycles.py
Created March 18, 2022 16:17
Cycle training pipeline
# 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"),
@cpcdoy
cpcdoy / kb_trie.py
Last active May 19, 2023 10:04
KB Trie example implementation using datrie
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.