Skip to content

Can't understand error:not all sentences have tests #1019

Answered by al-one
Darigaf asked this question in _Q&A
Discussion options

You must be logged in to vote

The length of the sentences tests must be greater than or equal to the length of the sentences.

test_count = sum(len(test["sentences"]) for test in content["tests"])
# Happens if the sentence file is invalid
if sentence_content is None:
continue
if intent in sentence_content["intents"]:
sentence_count = sum(
len(data["sentences"])
for data in sentence_content["intents"][intent]["data"]
)
if sentence_count > test_count:
errors.append(f"{path}: not all sentences have tests")

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by schizza
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
_Q&A
Labels
None yet
2 participants