All Projects → macournoyer → utterance_parser

macournoyer / utterance_parser

Licence: MIT License
Extract intent and entities from natural language utterances

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to utterance parser

chatbot
🤖️ 基于 PyTorch 的任务型聊天机器人(支持私有部署和 docker 部署的 Chatbot)
Stars: ✭ 77 (+126.47%)
Mutual labels:  slot-filling
slotminer
Tool for slot extraction from text
Stars: ✭ 15 (-55.88%)
Mutual labels:  slot-filling
JointIDSF
BERT-based joint intent detection and slot filling with intent-slot attention mechanism (INTERSPEECH 2021)
Stars: ✭ 55 (+61.76%)
Mutual labels:  slot-filling
OpenUE
OpenUE是一个轻量级知识图谱抽取工具 (An Open Toolkit for Universal Extraction from Text published at EMNLP2020: https://aclanthology.org/2020.emnlp-demos.1.pdf)
Stars: ✭ 274 (+705.88%)
Mutual labels:  slot-filling
Slotfilling
Using Tensorflow to train a slot-filling & intent joint model
Stars: ✭ 14 (-58.82%)
Mutual labels:  slot-filling
Deeppavlov
An open source library for deep learning end-to-end dialog systems and chatbots.
Stars: ✭ 5,525 (+16150%)
Mutual labels:  slot-filling
Snips Nlu
Snips Python library to extract meaning from text
Stars: ✭ 3,583 (+10438.24%)
Mutual labels:  slot-filling

UtteranceParser

A trainable natural language parser that extracts intent and entities from utterances.

It uses a Naive Bayes classifier to determine intent and Conditional random fields to extract entities.

For example, it can turn this:

Remind me to pick up the kids in two hours

into ...

[
  # intent
  "reminder",
  # entities
  {task: "pick up the kids", time: "in two hours"}
]

Installation

Add this line to your application's Gemfile:

gem 'utterance_parser'

And then execute:

$ bundle

Or install it yourself as:

$ gem install utterance_parser

Usage

parser = UtteranceParser.new

parser.train(
  # Utterance => intent
  "Hi" => "greeting",
  "Hello" => "greeting",

  "What time is it" => "time",
  "What's the weather outside" => "weather",

  # Mark entities using XML tags
  "Remind me to <task>get stuff done</task> <time>tomorrow</time>" => "reminder",
  "Remind me to <task>buy milk</task> <time>in one hour</time>" => "reminder",
  "Remind me to <task>pick up the kids</task> <time>in two hours</time>" => "reminder",

  "Play some <playlist>jazz</playlist>" => "play",
  "Play some <playlist>blues</playlist>" => "play",
  "Play some <playlist>rap</playlist>" => "play"
)

parser.parse "Hello there!"
# => ["greeting", {}]

parser.parse "Play some rock"
# => ["play", {playlist: "rock"}]

parser.parse "Remind me to buy stuff in three hours"
# => ["reminder", {task: "buy stuff", time: "in three hours"}]

Contributing

  1. Fork it ( https://github.com/macournoyer/utterance_parser/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].