An open API service indexing awesome lists of open source software.

https://github.com/Dev-Art-Solutions/SmoothLingua

SmoothLingua is an open-source conversational AI platform that empowers you to create and deploy intelligent conversational agents. It offers a versatile and customizable framework for building smart chatbots capable of comprehending and responding to user input.
https://github.com/Dev-Art-Solutions/SmoothLingua

Last synced: 3 months ago
JSON representation

SmoothLingua is an open-source conversational AI platform that empowers you to create and deploy intelligent conversational agents. It offers a versatile and customizable framework for building smart chatbots capable of comprehending and responding to user input.

Awesome Lists containing this project

README

          

# SmoothLingua

SmoothLingua is an open-source conversational AI platform that empowers you to create and deploy intelligent conversational agents. It offers a versatile and customizable framework for building smart chatbots capable of comprehending and responding to user input.

## Features

- **Intent Recognition:** Train your model to recognize user intents, such as greetings, farewells, inquiries, and more.

- **Story Management:** Define conversation flows using stories, specifying sequences of intents and corresponding bot responses.

- **Rule-Based Responses:** Create rules to handle specific scenarios and ensure precise responses.

- **Trainer Module:** Train your conversational agent with ease using the built-in trainer module.

- **Extensibility:** Extend SmoothLingua to integrate with your existing systems and services.

## Build status
![build and test](https://github.com/Dev-Art-Solutions/SmoothLingua/actions/workflows/build-and-test.yml/badge.svg)

## Quick Start

### Installation

Install SmoothLingua via NuGet Package Manager Console:

```bash
Install-Package SmoothLingua
```

### Example
```
using SmoothLingua;
using SmoothLingua.Abstractions;
using SmoothLingua.Abstractions.Stories;

MemoryStream memoryStream = new MemoryStream();

Trainer trainer = new Trainer();

trainer.Train(new Domain(
new List()
{
new SmoothLingua.Abstractions.NLU.Intent("Greeting",
new List(){ "Hello", "Hi" }),
new SmoothLingua.Abstractions.NLU.Intent("Good",
new List(){ "I am fine", "I am good, thank you" }),
new SmoothLingua.Abstractions.NLU.Intent("Bad",
new List(){ "I am feeling bad", "I am not good" }),
new SmoothLingua.Abstractions.NLU.Intent("Bye",
new List(){ "Good bye", "Bye" })
},
new List()
{
new Story("Good", new List()
{
new IntentStep("Greeting"),
new ResponseStep("Hello from bot!"),
new IntentStep("Good"),
new ResponseStep("I am glad to hear that!")
}),
new Story("Bad", new List()
{
new IntentStep("Greeting"),
new ResponseStep("Hello from bot!"),
new IntentStep("Bad"),
new ResponseStep("I am sorry to hear that!")
})
},
new List()
{
new SmoothLingua.Abstractions.Rules.Rule("Bye","Bye","Bye")
}
), memoryStream).Wait();

var conversationId = Guid.NewGuid().ToString();
var agent = await AgentLoader.Load(new MemoryStream(memoryStream.GetBuffer()));

var response = agent.Handle(conversationId, "bye");
Console.WriteLine($"Intent:{response.IntentName}");

foreach (var text in response.Messages)
{
Console.WriteLine($"Response:{text}");
}

response = agent.Handle(conversationId, "hello");
Console.WriteLine($"Intent:{response.IntentName}");

foreach (var text in response.Messages)
{
Console.WriteLine($"Response:{text}");
}

response = agent.Handle(conversationId, "I am fine");
Console.WriteLine($"Intent:{response.IntentName}");

foreach (var text in response.Messages)
{
Console.WriteLine($"Response:{text}");
}

response = agent.Handle(conversationId, "hello");
Console.WriteLine($"Intent:{response.IntentName}");

foreach (var text in response.Messages)
{
Console.WriteLine($"Response:{text}");
}

response = agent.Handle(conversationId, "I am bad");
Console.WriteLine($"Intent:{response.IntentName}");

foreach (var text in response.Messages)
{
Console.WriteLine($"Response:{text}");
}
```