Git Product home page Git Product logo

zero-shot-intent-classifier's Introduction

Zero-Shot Intent Classifier

This sort of thing used to be non-trivial. I hacked this together probably in like an hour.

Ho boy, the times: they are a changin.

What is this?

This is probably going to sound archaic in a few months, but a lot of "home assistant" type devices right now use a technique called "slot filling" under the hood. An "intent" classifier is the component that figures out what the relevant slots are and 'fills' them with values, resulting in a command being emitted and arguments passed. Instead of training one bespoke: you can probably just use this directly with no or very little modification.

Setup

  1. git clone <this repo>; cd <this repo>
  2. pip install -r requirements.txt
  3. Create a file named .env containing one line: OPENAI_API_KEY=..., replacing ... with your key.

Use

$ python main.py  "becca, how would I drive from my home to SeaTac airport?"
## {'intent': 'get_directions', 'arguments': {'start_location': 'home', 'end_location': 'SeaTac airport'}}

Compiled Prompt

Act as the intent classification component of a home assistant, similar to Amazon Alexa (except your name is 'Becca', not 'Alexa').
Common intents include: play_internet_radio, play_song_by_artist, get_weather, current_time, set_timer, remind_me
You receive input in json format: {"input":...}
You respond in json format: {"intent":..., "arguments":{ ... }, }}
{"input":{spoken_request}}

zero-shot-intent-classifier's People

Contributors

dmarx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

zero-shot-intent-classifier's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.