Improve fill-mask pipeline example in 03-pipelines notebook.

Remove hardcoded mask_token and use the value provided by the tokenizer.
This commit is contained in:
Morgan Funtowicz
2020-03-18 17:11:42 +01:00
parent 4b1970bb4c
commit cae334c43c

View File

@@ -294,7 +294,7 @@
], ],
"source": [ "source": [
"nlp_fill = pipeline('fill-mask')\n", "nlp_fill = pipeline('fill-mask')\n",
"nlp_fill('Hugging Face is a French company based in <mask>')" "nlp_fill('Hugging Face is a French company based in ' + nlp_fill.tokenizer.mask_token)"
] ]
}, },
{ {