sim
(Sim)
June 8, 2022, 9:15pm
1
I wonder if ES 8.2.2 already supports a PyTorch NLP model for summarization ?
Eg. sshleifer/distilbart-cnn-12-6 · Hugging Face
It's not an option in eland's current supported task types.
It is a generative model, ie. given a long text, will produce a short text.
If it cannot be formulated with current eland, could I do it programmatically like this way?
I'd be interested to know what's currently possible, and if not yet, when will it be available?
That summarizer is BART model.
Thanks,
Sim
dkyle
(David Kyle)
June 9, 2022, 8:44am
2
Hi Sim
Summarization isn't a task that is supported in any version of ES yet. I opened an GH issue for the enhancement requests at Support NLP summarization models · Issue #87548 · elastic/elasticsearch · GitHub , please upvote.
The good news is that Question Answering models will be supported in 8.3 and new features are being added all the time.
elastic:master
← benwtrent:feature/ml-add-question-answering-nlp-task
opened 04:21PM - 18 Apr 22 UTC
This commit adds a new `question_answering` task.
The `question_answering` ta… sk allows supplying a `question` in the inference config update.
When storing the model config for inference:
```
"inference_config": {
"question_answering": {
"tokenization": {...}, // tokenization settings, recommend doing 386 max sequence length with 128 span, and no truncating
"max_answer_length": 15 // the max answer length to consider
}
}
```
Then when calling `_infer` or running with in a pipeline, add the `question` you want answered given the context provided by the document text
```
{
"docs":[{ "text_field": <some long text field to extract answer}],
"inference_config": {
"question_answering": {
"question": <Question desiring answer>
}
}
}
```
The response then looks like:
```
{
"predicted_value": <string subsection of the document that is the answer>
"start_offset": <Char offset in document to start>,
"end_offset": <char offset end of the answer,
"prediction_probability": <prediction score>
}
```
Some models tested:
- https://huggingface.co/distilbert-base-cased-distilled-squad
- https://huggingface.co/bert-large-uncased-whole-word-masking-finetuned-squad
- https://huggingface.co/deepset/electra-base-squad2
- https://huggingface.co/deepset/tinyroberta-squad2
2 Likes
sim
(Sim)
June 9, 2022, 11:17pm
3
Nice @dkyle ! Upvoted.
That's cool, having Q&A in 8.3.
Before you saying that, I thought it's already in 8.2.2 because eland has question_answering task_type option already.
system
(system)
Closed
July 7, 2022, 11:18pm
4
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.