Fix deocde
This commit is contained in:
parent
cba104a29d
commit
a7cb40a0a0
@ -927,9 +927,9 @@ def main():
|
|||||||
if os.path.exists(params.context_file):
|
if os.path.exists(params.context_file):
|
||||||
contexts = []
|
contexts = []
|
||||||
for line in open(params.context_file).readlines():
|
for line in open(params.context_file).readlines():
|
||||||
contexts.append(line.strip())
|
contexts.append((sp.encode(line.strip()), 0.0))
|
||||||
context_graph = ContextGraph(params.context_score)
|
context_graph = ContextGraph(params.context_score)
|
||||||
context_graph.build(sp.encode(contexts))
|
context_graph.build(contexts)
|
||||||
else:
|
else:
|
||||||
context_graph = None
|
context_graph = None
|
||||||
else:
|
else:
|
||||||
|
|||||||
@ -1001,9 +1001,9 @@ def main():
|
|||||||
if os.path.exists(params.context_file):
|
if os.path.exists(params.context_file):
|
||||||
contexts = []
|
contexts = []
|
||||||
for line in open(params.context_file).readlines():
|
for line in open(params.context_file).readlines():
|
||||||
contexts.append(line.strip())
|
contexts.append((sp.encode(line.strip()), 0.0))
|
||||||
context_graph = ContextGraph(params.context_score)
|
context_graph = ContextGraph(params.context_score)
|
||||||
context_graph.build(sp.encode(contexts))
|
context_graph.build(contexts)
|
||||||
else:
|
else:
|
||||||
context_graph = None
|
context_graph = None
|
||||||
else:
|
else:
|
||||||
|
|||||||
@ -868,7 +868,7 @@ def main():
|
|||||||
contexts_text.append(line.strip())
|
contexts_text.append(line.strip())
|
||||||
contexts = graph_compiler.texts_to_ids(contexts_text)
|
contexts = graph_compiler.texts_to_ids(contexts_text)
|
||||||
context_graph = ContextGraph(params.context_score)
|
context_graph = ContextGraph(params.context_score)
|
||||||
context_graph.build(contexts)
|
context_graph.build([(c, 0.0) for c in contexts])
|
||||||
else:
|
else:
|
||||||
context_graph = None
|
context_graph = None
|
||||||
else:
|
else:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user