Skip to content

Commit

Permalink
weird missing dp logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Jemoka committed Dec 10, 2024
1 parent 40dc89b commit b3c7f79
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
3 changes: 2 additions & 1 deletion batchalign/pipelines/utterance/ud_utterance.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ def parse_tree(subtree):
for i in stack]

def process_ut(ut, nlp):

# remove punct
if (ut.content[-1].type == TokenType.PUNCT or
ut.content[-1].text in ENDING_PUNCT):
Expand Down Expand Up @@ -142,7 +143,7 @@ def process_ut(ut, nlp):
if isinstance(i, Match):
matches.append(i)
elif i.extra_type == ExtraType.REFERENCE:
new_refs.append(ReferenceTarget(key=i.key, payload=i.payload))
new_refs.append(ReferenceTarget(key=i.key, payload=i.payload if i.payload else -1))

# we now sort the references based on their orignial utterance order
matches = matches + new_refs
Expand Down
4 changes: 2 additions & 2 deletions batchalign/version
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
0.7.7-alpha.1
0.7.7-alpha.2
December 06, 2024
Changing some benchmarking form handling logic
DP logic
22 changes: 11 additions & 11 deletions scratchpad.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,23 +54,23 @@

# # ng = NgramRetraceEngine()
# # disf = DisfluencyReplacementEngine()
# doc = Document.new("in general, we have hair here.", lang="eng")
doc = Document.new("I am a very large chicken indeed.", lang="eng")

# forms, delim = chat_parse_utterance("in general, we have hair(stuff) here.", None, None, None, None)
# utterance = Utterance(content=forms, delim=delim)
# gold = Document(content=[utterance], langs=["eng"])
forms, delim = chat_parse_utterance("I am a very large chicken indeed.", None, None, None, None)
utterance = Utterance(content=forms, delim=delim)
gold = Document(content=[utterance], langs=["eng"])

# pipeline = BatchalignPipeline(EvaluationEngine())
# result = pipeline(doc, gold=gold)
pipeline = BatchalignPipeline(EvaluationEngine())
result = pipeline(doc, gold=gold)

# # pipeline = BatchalignPipeline.new("morphosyntax")
# # result2 = pipeline(gold)
# pipeline = BatchalignPipeline.new("morphosyntax")
# result2 = pipeline(gold)

# # print(str(CHATFile(doc=result2)))
# print(str(CHATFile(doc=result2)))


# result
# print(result["diff"])
result
print(result["diff"])


# # # # doc[0].content[4].text = "maman,"
Expand Down

0 comments on commit b3c7f79

Please sign in to comment.