# NLP Summarizer Model for ES 8.2.2

**URL:** <https://discuss.elastic.co/t/nlp-summarizer-model-for-es-8-2-2/306740>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-machine-learning\
**Created:** [June 8, 2022, 9:15pm UTC](https://discuss.elastic.co/t/nlp-summarizer-model-for-es-8-2-2/306740 "2022-06-08T21:15:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sim](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sim/32/106799_2.png) [@sim](https://discuss.elastic.co/u/sim)\
**Post date:** [June 8, 2022, 9:15pm UTC](https://discuss.elastic.co/t/nlp-summarizer-model-for-es-8-2-2/306740/1 "2022-06-08T21:15:28Z")

</div>

I wonder if ES 8.2.2 already supports a PyTorch NLP model for **summarization**?

Eg. [sshleifer/distilbart-cnn-12-6 · Hugging Face](https://huggingface.co/sshleifer/distilbart-cnn-12-6)

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?

> **[Machine Learning | Eland Python Client | Elastic](https://www.elastic.co/guide/en/elasticsearch/client/eland/current/machine-learning.html)**

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

---

<div class="post-metadata">

**Author:** ![dkyle](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dkyle/32/59114_2.png) [@dkyle](https://discuss.elastic.co/u/dkyle)\
**Post date:** [June 9, 2022, 8:44am UTC](https://discuss.elastic.co/t/nlp-summarizer-model-for-es-8-2-2/306740/2 "2022-06-09T08:44:14Z")

</div>

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](https://github.com/elastic/elasticsearch/issues/87548), 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.

> <https://github.com/elastic/elasticsearch/pull/85958>
>
> 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

---

<div class="post-metadata">

**Author:** ![sim](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sim/32/106799_2.png) [@sim](https://discuss.elastic.co/u/sim)\
**Post date:** [June 9, 2022, 11:17pm UTC](https://discuss.elastic.co/t/nlp-summarizer-model-for-es-8-2-2/306740/3 "2022-06-09T23:17:45Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 7, 2022, 11:18pm UTC](https://discuss.elastic.co/t/nlp-summarizer-model-for-es-8-2-2/306740/4 "2022-07-07T23:18:14Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
