Skip to content

Commit

Permalink
Merge pull request #52 from centre-for-humanities-computing/kf/fix-pr…
Browse files Browse the repository at this point in the history
…ompt-relation-extraction-test

Fixing prompt relation extraction component test that failed silently
  • Loading branch information
KasperFyhn authored Nov 17, 2023
2 parents 63c88c2 + e98a35b commit 3ef58c3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/test_prompt_relationextraction_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def create_test_api(prompt_template, api_key, model_name, api_kwargs):
"""

def test_api(target):
return api_response
return [api_response]

return test_api

Expand All @@ -74,8 +74,9 @@ def test_api(target):

doc = nlp(sample_thread)

assert doc._.relation_triplets is not None
for triplet in doc._.relation_triplets:
doc_relation_triplets = doc._.relation_triplets
assert doc_relation_triplets is not None and len(doc_relation_triplets) > 0
for triplet in doc_relation_triplets:
assert isinstance(triplet, SpanTriplet)
triplet in expected_span_triplets

Expand Down

0 comments on commit 3ef58c3

Please sign in to comment.