CoolFace
Modelpublic

ostorc/Conversational_Spanish_GPT

sourceHugging Faceupdated 3y agoView on Hugging Face
9likes21downloads
Model Card

Conversational Spanish GPT: Advancement in Spanish Conversational Models

Description

The Conversational Spanish GPT is a refined model based on DialoGPT-small, fine-tuned with a robust set of 96,437 conversations in Spanish. Created by Josemaría Vargas Vasconcellos, this model aims to serve as a solid foundation for the development of conversational models in Spanish.


Dataset

The model was trained using Spanish datasets available in Microsoft's Bot Framework Tools repository. A carefully curated set of 96,437 single-turn conversations in Spanish was meticulously selected to mitigate quality and coherence issues.


Evaluation

Limitations

After exhaustive evaluations, it was found that the model is not ideal for deployment as a contextual chatbot. However, it serves as a promising foundation for such applications. Responses tend to be brief and sometimes lack a defined focus due to conversation data diversity. Additionally, the wide range of personalities reflected in the data increases response variability.

Frequent repetitions in the data's responses have introduced certain "biases" into the model.

Conversations examples

Example 1
RoleResponse
UserHola
Bot¡Hola!
UserCómo te llamas?
BotNo tengo nombre.
UserQué edad tienes?
BotLos bots estamos exentos de cumplir años.
UserEres inteligente.
BotLo sé, de vez en cuando, puedo ser brillante.
User¿Crees que debería comprar un carro?
BotConfío en tu criterio.
Example 2
RoleResponse
Userestoy triste
BotSiento escuchar eso. Te mando muchos ánimos.
UserGracias
BotPerfecto.
User¿Tienes sentimientos?
BotNo tengo cuerpo.
UserA veces me siento solo.
BotOjalá pudiera ayudarte porque creo que eres la caña.
UserMe caes bien.
Bot¡Gracias! Me acabas de alegrar el día.
Example 3
RoleResponse
User¿De qué religión eres?
BotSoy un bot.
UserTienes amigos?
BotNo tengo el hardware necesario para eso.
UserNo eres humano.
BotAnotado.
User¿Quieres ser mi amigo?
Bot¡Claro que sí!
UserGracias.
BotGuay.

Usage

The model currently has its testing function disabled on HuggingFace due to inaccurate responses. However, users can experiment with the model using the provided code snippets:

python
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

CHAT_TURNS = 5
MAX_LENGTH = 1000

model = AutoModelForCausalLM.from_pretrained('ostorc/Conversational_Spanish_GPT')
tokenizer = AutoTokenizer.from_pretrained('ostorc/Conversational_Spanish_GPT')
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
model.to(device)
for i in range(CHAT_TURNS):
  user_input = input(f"Step - {i} >> Human ->")
  with torch.no_grad():
    # User turn, where "user_input" is the question (single-turn dialogue task)
    user_inputs_ids = tokenizer.encode(user_input + tokenizer.eos_token, return_tensors="pt")
    user_inputs_ids = user_inputs_ids.to(device)
    # The chat history adds the generated tokens for the answer
    chat_history = model.generate(user_inputs_ids, max_length=MAX_LENGTH, pad_token_id=tokenizer.eos_token_id)
    # decode just the last generated output tokens from the model (do not include the user prompt again)
    step_model_answer = tokenizer.decode(chat_history[:, user_inputs_ids.shape[-1]:][0], skip_special_tokens=True)
  print(f"Step - {i} >> Bot -> {step_model_answer}")

Suggestions:

If you come across any errors or have suggestions to enhance the model, feel free to share your thoughts in the accompanying comments. We appreciate your interest and collaboration.