Skip to content

Add XLM-RoBERTa model - #136

Merged
jonatanklosko merged 1 commit into
mainfrom
jk-xlm-roberta
Dec 21, 2022
Merged

Add XLM-RoBERTa model#136
jonatanklosko merged 1 commit into
mainfrom
jk-xlm-roberta

Conversation

@jonatanklosko

@jonatanklosko jonatanklosko commented Dec 21, 2022

Copy link
Copy Markdown
Member

Closes #134.

{:ok, model_info} = Bumblebee.load_model({:hf, "papluca/xlm-roberta-base-language-detection"})
{:ok, tokenizer} = Bumblebee.load_tokenizer({:hf, "papluca/xlm-roberta-base-language-detection"})
serving = Bumblebee.Text.text_classification(model_info, tokenizer)
Nx.Serving.run(serving, "Krak贸w w 艣niegu.")
#=> %{
#=>   predictions: [
#=>     %{label: "pl", score: 0.9958330988883972},
#=>     %{label: "el", score: 4.284092574380338e-4},
#=>     %{label: "bg", score: 4.1166096343658864e-4},
#=>     %{label: "es", score: 3.488743386697024e-4},
#=>     %{label: "de", score: 3.1762008438818157e-4}
#=>   ]
#=> }

@seanmor5 seanmor5 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beautiful!

@jonatanklosko
jonatanklosko merged commit 4d9a305 into main Dec 21, 2022
@jonatanklosko
jonatanklosko deleted the jk-xlm-roberta branch December 21, 2022 21:11
@kipcole9

Copy link
Copy Markdown

Wow! Just amazing work, thank you!

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

Successfully merging this pull request may close these issues.

[Feat request] Language identification

3 participants