Replace debugging prints by session logs.
This commit is contained in:
parent
79034f85a9
commit
6fb1e1e649
@ -128,7 +128,6 @@ class KnowledgeBase(object):
|
|||||||
knowledge_before = copy.deepcopy(self.knowledge)
|
knowledge_before = copy.deepcopy(self.knowledge)
|
||||||
with session().log("Process: {}".format(row)):
|
with session().log("Process: {}".format(row)):
|
||||||
tokens = self.tokenize(row)
|
tokens = self.tokenize(row)
|
||||||
print(tokens)
|
|
||||||
|
|
||||||
fit = parsing.get_fit(self, tokens)
|
fit = parsing.get_fit(self, tokens)
|
||||||
if fit is None:
|
if fit is None:
|
||||||
|
@ -65,8 +65,8 @@ def main():
|
|||||||
with session().log(example['text']):
|
with session().log(example['text']):
|
||||||
tokens = list(knowledge.tokenize(example['text']))
|
tokens = list(knowledge.tokenize(example['text']))
|
||||||
|
|
||||||
print(tokens)
|
session().log('Expected “{}”, found “{}”'
|
||||||
print(example['tokens'])
|
.format(tokens, example['tokens']))
|
||||||
assert example['tokens'] == tokens
|
assert example['tokens'] == tokens
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
from ..session.org_mode import (
|
||||||
|
global_session as session,
|
||||||
|
)
|
||||||
|
|
||||||
BASIC_TOKENIZATION_EXAMPLES = (
|
BASIC_TOKENIZATION_EXAMPLES = (
|
||||||
({
|
({
|
||||||
"text": 'cat',
|
"text": 'cat',
|
||||||
@ -15,5 +19,6 @@ BASIC_TOKENIZATION_EXAMPLES = (
|
|||||||
|
|
||||||
|
|
||||||
def train_basic_tokenization(knowledge_base):
|
def train_basic_tokenization(knowledge_base):
|
||||||
for example in BASIC_TOKENIZATION_EXAMPLES:
|
with session().log('Training basic tokenization'):
|
||||||
knowledge_base.train_tokenizer(example)
|
for example in BASIC_TOKENIZATION_EXAMPLES:
|
||||||
|
knowledge_base.train_tokenizer(example)
|
||||||
|
Loading…
Reference in New Issue
Block a user