# SentenceSimilarityInputsCheck expected dict not list: \`\_\_root\_\_\` in \`parameters\`

**URL:** <https://discuss.huggingface.co/t/sentencesimilarityinputscheck-expected-dict-not-list-root-in-parameters/39715>\
**Category:** Beginners\
**Created:** [May 13, 2023, 1:15am UTC](https://discuss.huggingface.co/t/sentencesimilarityinputscheck-expected-dict-not-list-root-in-parameters/39715 "2023-05-13T01:15:46Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Denaldo](https://avatars.discourse-cdn.com/v4/letter/d/779978/32.png) [@Denaldo](https://discuss.huggingface.co/u/Denaldo)\
**Post date:** [May 13, 2023, 1:15am UTC](https://discuss.huggingface.co/t/sentencesimilarityinputscheck-expected-dict-not-list-root-in-parameters/39715/1 "2023-05-13T01:15:46Z")

</div>

Hi,

I’m new to ML/AI and haven’t experimented much yet. I am a experienced developer in my day job though. I’m having a few issues I’m hoping someone can help me with. My main goal is the following.

I’m trying to write a bot that crawls a website, vectorizes all the text and stores this in pinecone db. Then the user can ask a question, and I query pinecone db for text that hopefully answers their question and feed that to chatgpt for it to answer the question. Everything seems to be working but the vector embedding/semantic search doesn’t seem to be returning text that really answers the question.

I am using the langchain js to do a lot of this, langchain has a HuggingFaceInferenceEmbeddings that I can use to vectorize text. The model it defaults to is the sentence-transformers/distilbert-base-nli-mean-tokens. I wanted to use a different model to see if I could get better results but when I try to use sentence-transformers/all-mpnet-base-v2 it throws the following error:

```auto
C:\projects\test\node_modules\.pnpm\@huggingface+inference@2.3.0\node_modules\@huggingface\inference\dist\index.js:136
        throw new Error(output.error);
              ^
Error: SentenceSimilarityInputsCheck expected dict not list: ` __root__ ` in `parameters`
    at request (C:\projects\test\node_modules\.pnpm\@huggingface+inference@2.3.0\node_modules\@huggingface\inference\dist\index.js:136:15)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async featureExtraction (C:\projects\test\node_modules\.pnpm\@huggingface+inference@2.3.0\node_modules\@huggingface\inference\dist\index.js:458:15)
    at async RetryOperation._fn (C:\projects\test\node_modules\.pnpm\p-retry@4.6.2\node_modules\p-retry\index.js:50:12) {
  attemptNumber: 7,
  retriesLeft: 0
}

```

There was a similar post here [Feature extraction using Inference API error](https://discuss.huggingface.co/t/feature-extraction-using-inference-api-error/13959) but I’m not sure what this means. I don’t understand the difference between sentence similarity and feature extraction. I tried to look it up but I couldn’t find much. I don’t understand how they differ, I just want to vectorize the text so I can store and query it from the db. Also I did take that answers advice and if I use something like [questgen/all-mpnet-base-v2-feature-extraction-pipeline · Hugging Face](https://huggingface.co/questgen/all-mpnet-base-v2-feature-extraction-pipeline) then it works, but this model only has ~90 downloads so I think I’m doing something wrong, or misunderstanding.

Any help would be appreciated. Thanks

---

<div class="post-metadata">

**Author:** ![radames](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/radames/32/28246_2.png) [@radames](https://discuss.huggingface.co/u/radames)\
**Post date:** [May 16, 2023, 12:29am UTC](https://discuss.huggingface.co/t/sentencesimilarityinputscheck-expected-dict-not-list-root-in-parameters/39715/2 "2023-05-16T00:29:54Z")

</div>

Hi @Denaldo,

Our API Inference supports multiple tasks. For certain models, we provide a straightforward abstraction for embedding similarity, such as with sentences. The `tag` and/or `pipeline_tag` establishes the correct task on the API Inference backend for all compatible models on our hub.

When using `sentence-similarity`, the backend establishes a sentence similarity pipeline. It expects multiple sentence inputs, which will subsequently be transformed into embeddings and compared through cosine similarity

When the model is set for `feature-extraction`, it expects the input sentence and returns the corresponding embeddings vector.

So if you need a model that is not supported into the `feature-extraction` pipeline, you can duplicate it and set the correct `tag` and `pipeline_tag`.  
You can check the [`README.md`](https://huggingface.co/questgen/all-mpnet-base-v2-feature-extraction-pipeline/blob/main/README.md) in different models for comparison

---

<div class="post-metadata">

**Author:** ![Denaldo](https://avatars.discourse-cdn.com/v4/letter/d/779978/32.png) [@Denaldo](https://discuss.huggingface.co/u/Denaldo)\
**Post date:** [May 16, 2023, 12:59am UTC](https://discuss.huggingface.co/t/sentencesimilarityinputscheck-expected-dict-not-list-root-in-parameters/39715/3 "2023-05-16T00:59:08Z")

</div>

Thank you for replying that makes a lot of sense. I’ve been a bit obsessive over this project so I’ve put in a insane amount of hours since I asked this question and have learned a lot.

---

<div class="post-metadata">

**Author:** ![nephel](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/nephel/32/17410_2.png) [@nephel](https://discuss.huggingface.co/u/nephel)\
**Post date:** [July 7, 2023, 1:47pm UTC](https://discuss.huggingface.co/t/sentencesimilarityinputscheck-expected-dict-not-list-root-in-parameters/39715/4 "2023-07-07T13:47:01Z")

</div>

I am using this model `sentence-transformers/multi-qa-mpnet-base-dot-v1`

> **[README.md · sentence-transformers/multi-qa-mpnet-base-dot-v1 at main](https://huggingface.co/sentence-transformers/multi-qa-mpnet-base-dot-v1/blob/main/README.md)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

I get the

```auto
Chain run errored with error: "SentenceSimilarityInputsCheck expected dict not list: ` __root__ ` in `parameters`"

```

when I try to use inference with `tiiuae/falcon-7b-instruct` or other models, regardless of how I edit the README file

Perhaps the bug is at the langchain side of things?

---

<div class="post-metadata">

**Author:** ![radames](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/radames/32/28246_2.png) [@radames](https://discuss.huggingface.co/u/radames)\
**Post date:** [July 7, 2023, 7:04pm UTC](https://discuss.huggingface.co/t/sentencesimilarityinputscheck-expected-dict-not-list-root-in-parameters/39715/5 "2023-07-07T19:04:42Z")

</div>

@nephel are you trying to use `sentence-transformers/multi-qa-mpnet-base-dot-v1` for feature extraction  
or sentence similarity?

---

<div class="post-metadata">

**Author:** ![nephel](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/nephel/32/17410_2.png) [@nephel](https://discuss.huggingface.co/u/nephel)\
**Post date:** [July 7, 2023, 9:04pm UTC](https://discuss.huggingface.co/t/sentencesimilarityinputscheck-expected-dict-not-list-root-in-parameters/39715/6 "2023-07-07T21:04:59Z")

</div>

Sentence similarity

I’ve also seen this [Error: SentenceSimilarityInputsCheck · Issue #1083 · hwchase17/langchainjs · GitHub](https://github.com/hwchase17/langchainjs/issues/1083)

---

<div class="post-metadata">

**Author:** ![Telenovela1](https://avatars.discourse-cdn.com/v4/letter/t/a3d4f5/32.png) [@Telenovela1](https://discuss.huggingface.co/u/Telenovela1)\
**Post date:** [August 11, 2023, 9:41am UTC](https://discuss.huggingface.co/t/sentencesimilarityinputscheck-expected-dict-not-list-root-in-parameters/39715/7 "2023-08-11T09:41:45Z")

</div>

Hello friends I need help with these errors…My client site is effected…please help

---

<div class="post-metadata">

**Author:** ![Telenovela1](https://avatars.discourse-cdn.com/v4/letter/t/a3d4f5/32.png) [@Telenovela1](https://discuss.huggingface.co/u/Telenovela1)\
**Post date:** [August 11, 2023, 9:49am UTC](https://discuss.huggingface.co/t/sentencesimilarityinputscheck-expected-dict-not-list-root-in-parameters/39715/8 "2023-08-11T09:49:29Z")

</div>

My clint website still has issues is core web vitals how i can fix it…This website is totaly on drama and [Telenovela](https://telenovela1.com/) series like as entertainment dramas …please help me.@nephel
