HumanSignal/label-studio-ml-backend

Machine Learning with Conversation Slot filling

sandeepbhutani304 opened this issue · 1 comments

We are trying to put huggingface-ner sample as machine learning model behind template - Conversational AI - Intent classification and slot filling.
We are able to do the prediction using below code. In below code we have taken text of each dialog and sent to the model. Model is returning predictions as well.

We are now stuck at display the predictions back to UI. Please tell us what changes are needed, so that the UI accepts the returned predictions in json reply, and show them in the dialogues.

if "entity_slot" in li._control_tags:
                from_name = 'ParagraphLabels'; to_name='dialogue'; #TODO: not sure what is purpose of this
                dialogues = [task['data']['humanMachineDialogue'] for task in tasks]
                for dialogue in dialogues:
                    for turn in dialogue:
                        if 'text' in turn:
                            texts.append(turn['text'])

Hello!

In order to return predictions for <ParagraphLabels>, you have to follow the JSON format for predictions' value: https://labelstud.io/tags/paragraphs#Example-JSON . Try to replace plain text NER with the format expected by Paragraphs.
Also, make sure the model is selected in Label Studio project Settings > Annotation > Live Predictions .
Let me know if any of these recipes helps.