# Missing Endpoint for NLI

**URL:** <https://discuss.huggingface.co/t/missing-endpoint-for-nli/37947>\
**Category:** Inference Endpoints on the Hub\
**Created:** [April 27, 2023, 7:03pm UTC](https://discuss.huggingface.co/t/missing-endpoint-for-nli/37947 "2023-04-27T19:03:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel391](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@Daniel391](https://discuss.huggingface.co/u/Daniel391)\
**Post date:** [April 27, 2023, 7:03pm UTC](https://discuss.huggingface.co/t/missing-endpoint-for-nli/37947/1 "2023-04-27T19:03:32Z")

</div>

I think we are missing an API Endpoint for NLI Models like [facebook/bart-large-mnli · Hugging Face](https://huggingface.co/facebook/bart-large-mnli) - So that we can get the entailment scores of an arbitrary hypothesis. Is that correct?

Thank you for any insights!

---

<div class="post-metadata">

**Author:** ![philschmid](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/philschmid/32/38022_2.png) [@philschmid](https://discuss.huggingface.co/u/philschmid)\
**Post date:** [April 28, 2023, 6:22am UTC](https://discuss.huggingface.co/t/missing-endpoint-for-nli/37947/2 "2023-04-28T06:22:59Z")

</div>

You can change the model task when deploying the model from `zero-shot-classification` to `text-classification`.

 ![image](https://us1.discourse-cdn.com/hellohellohello/original/2X/8/865bfdecf42f4bf43f8c53e0243a7548529c366c.png)

---

<div class="post-metadata">

**Author:** ![Daniel391](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@Daniel391](https://discuss.huggingface.co/u/Daniel391)\
**Post date:** [April 28, 2023, 12:13pm UTC](https://discuss.huggingface.co/t/missing-endpoint-for-nli/37947/3 "2023-04-28T12:13:50Z")

</div>

Thank you, but how does the model know what the premise is and what the hypothesis is? I thought that this is an implementation detail of the model, and so an API that would abstract that away seems to be missing.

I found the following thread: [How to separate premise and hypothesis in Inference API](https://discuss.huggingface.co/t/how-to-separate-premise-and-hypothesis-in-inference-api/4194) - It discusses this exact problem. From that thread, it looks to me like its different from model to model.

Thank you again for any insights!

---

<div class="post-metadata">

**Author:** ![philschmid](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/philschmid/32/38022_2.png) [@philschmid](https://discuss.huggingface.co/u/philschmid)\
**Post date:** [April 28, 2023, 12:40pm UTC](https://discuss.huggingface.co/t/missing-endpoint-for-nli/37947/4 "2023-04-28T12:40:00Z")

</div>

If you need more customization you can create a custom handler and define those manually: [Create custom Inference Handler](https://huggingface.co/docs/inference-endpoints/guides/custom_handler)

---

<div class="post-metadata">

**Author:** ![Daniel391](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@Daniel391](https://discuss.huggingface.co/u/Daniel391)\
**Post date:** [April 28, 2023, 1:16pm UTC](https://discuss.huggingface.co/t/missing-endpoint-for-nli/37947/5 "2023-04-28T13:16:18Z")

</div>

Okay, I realize I probably have used the wrong subforum/category. What category should I use for asking about the free [Inference API](https://huggingface.co/inference-api)?

As I understand it, for the free Inference API there is a fixed set of tasks:

> **[Detailed parameters](https://huggingface.co/docs/api-inference/detailed_parameters)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

And what task a particular repository can be used for, depends on the `pipeline_tag` set in the `README.md`.

But looking at the above link, for NLI there is no such tag one could use. There is only one for `text-classification`, but then again the format required for the NLI Task is unknown. So I feel like an Endpoint is missing there?

Thank you
