DeepMount00 / Anita

huggingface.co
Total runs: 751
24-hour runs: 0
7-day runs: 262
30-day runs: 446
Model's Last Updated: April 25 2024
sentence-similarity

Introduction of Anita

Model Details of Anita

  • Version: 2
  • Release Date: April 23, 2024
Intended Use

This model is designed for the specific task of question answering (Q&A) in Italian. It is intended for applications that require understanding and processing Italian language queries to identify the most relevant context where an answer can be found. Suitable use cases include but are not limited to customer support automation, educational tools, and information retrieval systems.

Model Description

The Italian Q&A Sentence Transformer is trained to comprehend and analyze Italian text. Given a question, the model predicts the most probable context containing the answer by mapping sentences to a high-dimensional space. The model uses a transformer-based architecture, optimized specifically for the nuances of the Italian language.

How to use
from transformers import AutoTokenizer, AutoModel
import torch
from sklearn.metrics.pairwise import cosine_similarity
from sklearn.preprocessing import normalize

# Load model and tokenizer
model_name = "DeepMount00/Anita"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModel.from_pretrained(model_name)

# Prepare sentences
sentences = [
    "Cosa faceva ogni sera Luca?",
    "Un cane felice corre nel parco, la coda ondeggiante al vento. Ogni erba, ogni farfalla, un'avventura. Occhi scintillanti, lingua penzolante, esplora gioiosamente, amato e coccolato dal suo fedele compagno umano. Insieme, condividono un legame indissolubile, tessuto di corse, giochi e affetto incondizionato.",
    "In un piccolo paesino circondato da colline verdeggianti e campi fioriti viveva una persona il cui sorriso era capace di illuminare la giornata più grigia. Questa persona, di nome Luca, aveva trovato la chiave della felicità nelle piccole gioie quotidiane: il profumo del caffè al mattino, il suono ridente dei bambini che giocavano in piazza, il tramonto che dipingeva il cielo di arancione e viola ogni sera."
]

# Tokenize, encode, and compute embeddings
embeddings = []
with torch.no_grad():
    for sentence in sentences:
        encoded_input = tokenizer(sentence, return_tensors='pt', padding=True, truncation=True, max_length=512)
        embedding = model(**encoded_input).pooler_output
        embeddings.append(embedding)

# Convert embeddings to numpy and normalize
embeddings = torch.cat(embeddings, dim=0).numpy()

# Calculate cosine similarity
similarity_matrix = cosine_similarity(embeddings)

# Print similarity scores
print("Similarità tra la sentenza 1 e 2:", similarity_matrix[0, 1])
print("Similarità tra la sentenza 1 e 3:", similarity_matrix[0, 2])
print("Similarità tra la sentenza 2 e 3:", similarity_matrix[1, 2])
How to use with SentenceTransformer
pip install -U sentence-transformers
from sentence_transformers import SentenceTransformer
sentences = ["Oggi sono andato al mare", "La torre di Pisa si trova in Toscana"]

model = SentenceTransformer('DeepMount00/Anita')
embeddings = model.encode(sentences)
print(embeddings)

Runs of DeepMount00 Anita on huggingface.co

751
Total runs
0
24-hour runs
266
3-day runs
262
7-day runs
446
30-day runs

More Information About Anita huggingface.co Model

Anita huggingface.co

Anita huggingface.co is an AI model on huggingface.co that provides Anita's model effect (), which can be used instantly with this DeepMount00 Anita model. huggingface.co supports a free trial of the Anita model, and also provides paid use of the Anita. Support call Anita model through api, including Node.js, Python, http.

DeepMount00 Anita online free

Anita huggingface.co is an online trial and call api platform, which integrates Anita's modeling effects, including api services, and provides a free online trial of Anita, you can try Anita online for free by clicking the link below.

DeepMount00 Anita online free url in huggingface.co:

https://huggingface.co/DeepMount00/Anita

Anita install

Anita is an open source model from GitHub that offers a free installation service, and any user can find Anita on GitHub to install. At the same time, huggingface.co provides the effect of Anita install, users can directly use Anita installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

Anita install url in huggingface.co:

https://huggingface.co/DeepMount00/Anita

Url of Anita

Provider of Anita huggingface.co

DeepMount00
ORGANIZATIONS

Other API from DeepMount00