Hi, Prodigy Community!
As the title mentions, I have been trying to get textcat.correct to work and it is not streaming data to Prodigy.
I had to make some changes to the recipe in order to fit the need. I had generated the scores from the model before sending it through the textcat.correct recipe. However, I had made sure that it is the right format as you can see in the example below.
Output generated by model:
{
"id": "xxxxxxx",
"results": {
"daca": [
[
"xxx",
{
"np": 0.014070617966353893,
"rr": 0.8976043462753296,
"or": 0.01625574380159378,
"f": 0.0028465630020946264,
"na": 0.0010143289109691978,
"p": 0.007620492484420538
}
]
],
"us": [
[
"",
{
"np": 0,
"rr": 0,
"or": 0,
"files": 0,
"na": 0,
"p": 0
}
],
[
"",
{
"np": 0,
"rr": 0,
"or": 0,
"f": 0,
"na": 0,
"p": 0
}
]
]
}
}
Data sent into textcat.correct recipe:
{
"paper_uuid": "xxxxxxx",
"text": "xxx",
"answer": "reject",
"accepted": [],
"options": [
{
"id": "or",
"text": "or",
"meta": 0
},
{
"id": "rr",
"text": "rr",
"meta": 0
},
{
"id": "np",
"text": "np",
"meta": 0
},
{
"id": "na",
"text": "na",
"meta": 0
},
{
"id": "f",
"text": "f",
"meta": 0
},
{
"id": "p",
"text": "p",
"meta": 0
}
],
"accept": []
}
The reformed add_suggestion function looks like the following:
def add_suggestions(stream):
for eg in stream:
task = copy.deepcopy(eg)
yield task
My dataset has 10902 records. But, only 11 records were streamed in. Out of those 11 records, I was able to annotate only 1 and the other 10 were automatically accepted/rejected. I had then blocked out the update section in the recipe but nothing changed.
If anybody could shed some light on why this is happening, it'd be really helpful. Thank you.