{"id":13549802,"url":"https://github.com/MycroftAI/adapt","last_synced_at":"2025-04-02T23:31:08.664Z","repository":{"id":46620067,"uuid":"42082724","full_name":"MycroftAI/adapt","owner":"MycroftAI","description":"Adapt Intent Parser","archived":false,"fork":false,"pushed_at":"2024-07-21T21:46:45.000Z","size":370,"stargazers_count":713,"open_issues_count":12,"forks_count":155,"subscribers_count":75,"default_branch":"master","last_synced_at":"2025-03-27T22:08:31.122Z","etag":null,"topics":["intent-parser","intents","open-source","opensource","speech-recognition","speech-to-text"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MycroftAI.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":"SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-09-08T01:28:48.000Z","updated_at":"2025-02-20T23:25:01.000Z","dependencies_parsed_at":"2024-08-01T12:17:22.220Z","dependency_job_id":null,"html_url":"https://github.com/MycroftAI/adapt","commit_stats":{"total_commits":154,"total_committers":21,"mean_commits":7.333333333333333,"dds":0.6233766233766234,"last_synced_commit":"4445f3cc875009ef31f03dba0e8355a085a655b3"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MycroftAI%2Fadapt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MycroftAI%2Fadapt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MycroftAI%2Fadapt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MycroftAI%2Fadapt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MycroftAI","download_url":"https://codeload.github.com/MycroftAI/adapt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246910920,"owners_count":20853652,"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":["intent-parser","intents","open-source","opensource","speech-recognition","speech-to-text"],"created_at":"2024-08-01T12:01:25.697Z","updated_at":"2025-04-02T23:31:08.030Z","avatar_url":"https://github.com/MycroftAI.png","language":"Python","readme":"[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE.md) [![CLA](https://img.shields.io/badge/CLA%3F-Required-blue.svg)](https://mycroft.ai/cla) [![Team](https://img.shields.io/badge/Team-Mycroft_Core-violetblue.svg)](https://github.com/MycroftAI/contributors/blob/master/team/Mycroft%20Core.md) ![Status](https://img.shields.io/badge/-Production_ready-green.svg)\n\n[![Build Status](https://travis-ci.org/MycroftAI/adapt.svg?branch=master)](https://travis-ci.org/MycroftAI/adapt) [![Coverage Status](https://coveralls.io/repos/github/MycroftAI/adapt/badge.svg?branch=dev)](https://coveralls.io/github/MycroftAI/adapt?branch=master)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com)\n[![Join chat](https://img.shields.io/badge/Mattermost-join_chat-brightgreen.svg)](https://chat.mycroft.ai)\n\nAdapt Intent Parser\n==================\nThe Adapt Intent Parser is a flexible and extensible intent definition and determination framework. It is intended to parse natural language text into a structured intent that can then be invoked programatically.\n\n[![Introducing the Adapt Intent Parser](https://mycroft.ai/wp-content/uploads/2019/05/Adapt-video-still.png)](https://www.youtube.com/watch?v=zR9xvPtM6Ro)\n\nGetting Started\n===============\nTo take a dependency on Adapt, it's recommended to use virtualenv and pip to install source from github.\n\n```bash\n$ virtualenv myvirtualenv\n$ . myvirtualenv/bin/activate\n$ pip install -e git+https://github.com/mycroftai/adapt#egg=adapt-parser\n```\n\nExamples\n========\nExecutable examples can be found in the [examples folder](https://github.com/MycroftAI/adapt/tree/master/examples).\n\nIntent Modelling\n================\nIn this context, an Intent is an action the system should perform. In the context of Pandora, we’ll define two actions: List Stations, and Select Station (aka start playback)\n\nWith the Adapt intent builder:\n```Python\nlist_stations_intent = IntentBuilder('pandora:list_stations')\\\n    .require('Browse Music Command')\\\n    .build()\n```\n\nFor the above, we are describing a “List Stations” intent, which has a single requirement of a “Browse Music Command” entity.\n\n```Python\nplay_music_command = IntentBuilder('pandora:select_station')\\\n    .require('Listen Command')\\\n    .require('Pandora Station')\\\n    .optionally('Music Keyword')\\\n    .build()\n```\n\n\nFor the above, we are describing a “Select Station” (aka start playback) intent, which requires a “Listen Command” entity, a “Pandora Station”, and optionally a “Music Keyword” entity.\n\nEntities\n========\n\nEntities are a named value. Examples include:\n`Blink 182` is an `Artist`\n`The Big Bang Theory` is a `Television Show`\n`Play` is a `Listen Command`\n`Song(s)` is a `Music Keyword`\n\nFor my Pandora implementation, there is a static set of vocabulary for the Browse Music Command, Listen Command, and Music Keyword (defined by me, a native english speaker and all-around good guy). Pandora Station entities are populated via a \"List Stations\" API call to Pandora. Here’s what the vocabulary registration looks like.\n\n```Python\ndef register_vocab(entity_type, entity_value):\n    pass\n    # a tiny bit of code \n\ndef register_pandora_vocab(emitter):\n    for v in [\"stations\"]:\n        register_vocab('Browse Music Command', v)\n\n    for v in [\"play\", \"listen\", \"hear\"]:\n        register_vocab('Listen Command', v)\n\n    for v in [\"music\", \"radio\"]:\n        register_vocab('Music Keyword', v)\n\n    for v in [\"Pandora\"]:\n        register_vocab('Plugin Name', v)\n\n    station_name_regex = re.compile(r\"(.*) Radio\")\n    p = get_pandora()\n    for station in p.stations:\n        m = station_name_regex.match(station.get('stationName'))\n        if not m:\n            continue\n        for match in m.groups():\n            register_vocab('Pandora Station', match)\n```\n\nDevelopment\n===========\n\nGlad you'd like to help!\n\nTo install test and development requirements run\n\n```\npip install -r test-requirements.txt\n```\n\nThis will install the test-requirements as well as the runtime requirements for adapt.\n\nTo test any changes before submitting them run\n\n```\n./run_tests.sh\n```\n\nThis will run the same checks as the Github actions and verify that your code should pass with flying colours.\n\nReporting Issues\n================\nIt's often difficult to debug issues with adapt without a complete context. To facilitate simpler debugging,\nplease include a serialized copy of the intent determination engine using the debug dump\nutilities.\n\n```python\nfrom adapt.engine import IntentDeterminationEngine\nengine = IntentDeterminationEngine()\n# Load engine with vocabulary and parsers\n\nimport adapt.tools.debug as atd\natd.dump(engine, 'debug.adapt')\n```\n\nLearn More\n========\n\nFurther documentation can be found at https://mycroft-ai.gitbook.io/docs/mycroft-technologies/adapt\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMycroftAI%2Fadapt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMycroftAI%2Fadapt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMycroftAI%2Fadapt/lists"}