Most similar Text / Recommend items

This task calculates the text similarity of multiple item to a query.

Input

Embedding model

Description

The task offers calculates the (cosine) similarity between a query text and item texts. It allows to enter a list of item texts and a query that is compared with the item texts.

Applications

• Recommendation: List the most similar items.

• Sentiment Analysis: Understand sentiments by comparing text similarities.

• Text Classification: Aid in categorizing and organizing texts efficiently.

How to use the task

  1. Input the query, the items and the embedding model (that defines how to compare the texts) you want to use.

  2. Click the "Run Task" button.

  3. Instantly, you'll receive a similarity score that quantifies the items and their similarity to the query ordered by their similarity to the query.

Privacy

Please do not use any sensitive input.

[1.0.0]:
First version
VersionAI ModelCreatedLink
1.0.0openai30.07.2023

API

The REST API allows you to call the tool with the same costs as when running the tool. Please generate an Personal access token before using the REST API.

Parameters

  • query (Query): The query that should be compared to the other items
  • items (Items): The items that should be compared to the query
  • model (Embedding model): Defines the embedding model
  • Call the REST API by cURL
    curl -v -H "Authorization: Bearer PERSONAL_ACCESS_TOKEN" https://api.anysolve.ai/rest/v1/intern-embeddings-text-recommendation/1.0.0?query=States%20of%20the%20USA&items=Texas&model=text-embedding-ada-002
  • Install the package with pip
    python3 -m pip install anysolve
  • Run in python3
    import os
    from anysolve import AnySolve
    anysolve_token = os.environ.get('ANYSOLVE_PERSONAL_ACCESS_TOKEN') # Resolve your personal access token here
    client = AnySolve(anysolve_token)
    res = client.run('intern-embeddings-text-recommendation','1.0.0', {'query': 'States of the USA', 'items': 'Texas', 'model': 'text-embedding-ada-002'})
    print(res)
  • Coming soon: Within AnySolve ChatComplete prompts you can use the following command to execute the task:
    /run('intern-embeddings-text-recommendation','1.0.0', query='States of the USA', items='Texas', model='text-embedding-ada-002')