Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Machine Learning with Conversation Slot filling #526

Open
sandeepbhutani304 opened this issue Apr 22, 2024 · 1 comment
Open

Machine Learning with Conversation Slot filling #526

sandeepbhutani304 opened this issue Apr 22, 2024 · 1 comment

Comments

@sandeepbhutani304
Copy link

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'])
@niklub
Copy link
Contributor

niklub commented May 2, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants