{"id":13472629,"url":"https://github.com/spro/pytorch-seq2seq-intent-parsing","last_synced_at":"2026-01-21T23:46:26.942Z","repository":{"id":69728498,"uuid":"87484365","full_name":"spro/pytorch-seq2seq-intent-parsing","owner":"spro","description":"Intent parsing and slot filling in PyTorch with seq2seq + attention","archived":false,"fork":false,"pushed_at":"2017-06-08T21:35:42.000Z","size":14,"stargazers_count":159,"open_issues_count":5,"forks_count":29,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-20T09:57:38.676Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-04-06T23:30:35.000Z","updated_at":"2025-01-23T06:00:32.000Z","dependencies_parsed_at":"2023-03-13T20:24:50.489Z","dependency_job_id":null,"html_url":"https://github.com/spro/pytorch-seq2seq-intent-parsing","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spro%2Fpytorch-seq2seq-intent-parsing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spro%2Fpytorch-seq2seq-intent-parsing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spro%2Fpytorch-seq2seq-intent-parsing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spro%2Fpytorch-seq2seq-intent-parsing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spro","download_url":"https://codeload.github.com/spro/pytorch-seq2seq-intent-parsing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245702168,"owners_count":20658557,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T16:00:56.406Z","updated_at":"2026-01-21T23:46:26.916Z","avatar_url":"https://github.com/spro.png","language":"Python","funding_links":[],"categories":["Python","Paper implementations｜论文实现","Paper implementations"],"sub_categories":["Other libraries｜其他库:","Other libraries:"],"readme":"# PyTorch Seq2Seq Intent Parsing\n\nReframing intent parsing as a human - machine translation task. Work in progress successor to [torch-seq2seq-intent-parsing](https://github.com/spro/torch-seq2seq-intent-parsing)\n\n## The command language\n\nThis is a simple command language developed for the \"home assistant\" [Maia](https://github.com/withmaia) living in my apartment. She's designed as a collection of microservices with services for lights (Hue), switches (WeMo), and info such as weather and market prices.\n\nA command consists of a \"service\", a \"method\", and some number of arguments.\n\n```\nlights setState office_light on\nswitches getState teapot\nweather getWeather \"San Francisco\"\nprice getPrice TSLA\n```\n\nThese can be represented with variable placeholders:\n\n```\nlights setState $device $state\nswitches getState $device\nweather getWeather $location\nprice getPrice $symbol\n```\n\nWe can imagine a bunch of human sentences that would map to a single command:\n\n```\n\"Turn the office light on.\"\n\"Please turn on the light in the office.\"\n\"Maia could you set the office light on, thank you.\"\n```\n\nWhich could similarly be represented with placeholders.\n\n## TODO: Specific vs. freeform variables\n\nA shortcoming of the approach so far is that the model has to learn translations of specific values, for example mapping all of the device names to their equivalent `device_name`. If we added a \"basement light\" the model would have no `basement_light` in the output vocabulary unless it was re-trained.\n\nThe bigger the potential input space, the more obvious the problem - consider the `getWeather` command, where the model would need to be trained with every possible location we might ask about. Worse yet, consider a `playMusic` command that could take any song or artist name...\n\n\nThis can be solved with a technique which I have [implemented in Torch here](https://github.com/spro/torch-seq2seq-intent-parsing). The training pairs have \"variable placeholders\" in the output translation, which the model generates during an intial pass. Then the network fills in the values of these placeholders with an additional pass over the input.\n\n![](https://camo.githubusercontent.com/4125995f183d3158103b46eeb5ffdea4eef0ef52/68747470733a2f2f692e696d6775722e636f6d2f56316c747668492e706e67)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspro%2Fpytorch-seq2seq-intent-parsing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspro%2Fpytorch-seq2seq-intent-parsing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspro%2Fpytorch-seq2seq-intent-parsing/lists"}