Comments (6)
Hey @whtecmp thanks for filing an issue! Just for clarity, you're using adapt via mycroft-core, correct? I'm happy to dig in, but it would be helpful to have more context on the queries you're issuing (the utterances being sent to adapt), as well as the full vocab contents of the parser.
Best would be a PR with a failing unit test, and I can dig into what's happening. I'll check briefly on the regex above, but if I'm unable to reproduce I won't be able to get much farther without the above.
Thanks!
from adapt.
I was able to confirm that the tagger is finding digits. Can you provide some more detail on the structure of your Intent
s, and the rest of the loaded vocabulary?
In [2]: from adapt.engine import IntentDeterminationEngine
In [3]: engine = IntentDeterminationEngine
In [4]: engine = IntentDeterminationEngine()
In [5]: engine
Out[5]: <adapt.engine.IntentDeterminationEngine at 0x7feadc56bac0>
In [6]: engine.register_regex_entity(".* (?P<number>[0-9]+) .*")
In [7]: engine.tagger.regex_entities
Out[7]: [re.compile(r'.* (?P<number>[0-9]+) .*', re.IGNORECASE|re.UNICODE)]
In [8]: engine.tagger.tag("what is the 1 way to kill a vampire?"
...: )
Out[8]:
[{'match': '1',
'key': '1',
'start_token': 3,
'entities': [{'key': '1',
'match': '1',
'data': [('1', 'number')],
'confidence': 0.5}],
'end_token': 3,
'from_context': False},
{'match': '1',
'key': '1',
'start_token': 3,
'entities': [{'key': '1',
'match': '1',
'data': [('1', 'number')],
'confidence': 0.5}],
'end_token': 3,
'from_context': False},
{'match': '1',
'key': '1',
'start_token': 3,
'entities': [{'key': '1',
'match': '1',
'data': [('1', 'number')],
'confidence': 0.5}],
'end_token': 3,
'from_context': False},
{'match': '1',
'key': '1',
'start_token': 3,
'entities': [{'key': '1',
'match': '1',
'data': [('1', 'number')],
'confidence': 0.5}],
'end_token': 3,
'from_context': False},
{'match': '1',
'key': '1',
'start_token': 3,
'entities': [{'key': '1',
'match': '1',
'data': [('1', 'number')],
'confidence': 0.5}],
'end_token': 3,
'from_context': False},
{'match': '1',
'key': '1',
'start_token': 3,
'entities': [{'key': '1',
'match': '1',
'data': [('1', 'number')],
'confidence': 0.5}],
'end_token': 3,
'from_context': False},
{'match': '1',
'key': '1',
'start_token': 3,
'entities': [{'key': '1',
'match': '1',
'data': [('1', 'number')],
'confidence': 0.5}],
'end_token': 3,
'from_context': False},
{'match': '1',
'key': '1',
'start_token': 3,
'entities': [{'key': '1',
'match': '1',
'data': [('1', 'number')],
'confidence': 0.5}],
'end_token': 3,
'from_context': False},
{'match': '1',
'key': '1',
'start_token': 3,
'entities': [{'key': '1',
'match': '1',
'data': [('1', 'number')],
'confidence': 0.5}],
'end_token': 3,
'from_context': False},
{'match': '1',
'key': '1',
'start_token': 3,
'entities': [{'key': '1',
'match': '1',
'data': [('1', 'number')],
'confidence': 0.5}],
'end_token': 3,
'from_context': False},
{'match': '1',
'key': '1',
'start_token': 3,
'entities': [{'key': '1',
'match': '1',
'data': [('1', 'number')],
'confidence': 0.5}],
'end_token': 3,
'from_context': False},
{'match': '1',
'key': '1',
'start_token': 3,
'entities': [{'key': '1',
'match': '1',
'data': [('1', 'number')],
'confidence': 0.5}],
'end_token': 3,
'from_context': False},
{'match': '1',
'key': '1',
'start_token': 3,
'entities': [{'key': '1',
'match': '1',
'data': [('1', 'number')],
'confidence': 0.5}],
'end_token': 3,
'from_context': False},
{'match': '1',
'key': '1',
'start_token': 3,
'entities': [{'key': '1',
'match': '1',
'data': [('1', 'number')],
'confidence': 0.5}],
'end_token': 3,
'from_context': False},
{'match': '1',
'key': '1',
'start_token': 3,
'entities': [{'key': '1',
'match': '1',
'data': [('1', 'number')],
'confidence': 0.5}],
'end_token': 3,
'from_context': False},
{'match': '1',
'key': '1',
'start_token': 3,
'entities': [{'key': '1',
'match': '1',
'data': [('1', 'number')],
'confidence': 0.5}],
'end_token': 3,
'from_context': False},
{'match': '1',
'key': '1',
'start_token': 3,
'entities': [{'key': '1',
'match': '1',
'data': [('1', 'number')],
'confidence': 0.5}],
'end_token': 3,
'from_context': False},
{'match': '1',
'key': '1',
'start_token': 3,
'entities': [{'key': '1',
'match': '1',
'data': [('1', 'number')],
'confidence': 0.5}],
'end_token': 3,
'from_context': False}]
from adapt.
This issue came up when I was playing around with some examples, so I don't have an "actual use case", but what I tried is this:
number.rx:
.* (?P<number>[0-9]+) .*
test.voc:
test
__init__.py:
@intent_handler(IntentBuilder('Intent').require('test').require('number'))
def handle_test(self, message):
self.speak('Got here!')
And the utterance I'm trying is: "test 4 test".
But I never get to the "Got here"
I'm using the cli, and I tried both "4" and "four" as the number.
from adapt.
Hrmm..... interesting. I think it might be worthwhile to hop into the mycroft chat and have someone help debug the skill with you. It's a little bit of magic to dig the adapt internals out of a mycroft skill, but they should be able to help you. I apologize, I'm not as familiar with the debugging internals there anymore.
from adapt.
@whtecmp It's possible this is another issue stemming from #136. I'm hoping that merges shortly and mycroft-core will pull it in shortly after that.
from adapt.
@whtecmp if you have a chance to try out #136 , please let me know if this addresses your issue. I'm also going to be close out stale issues on 9/17, this one included. Thanks!
from adapt.
Related Issues (20)
- Using keyword "my" results in regex problems HOT 9
- Possible Regression using two or more regex HOT 3
- How do I use audio for intent classification? Any code? HOT 2
- upgrade to latest pyee HOT 1
- Confusing examples: MultiIntent* examples define unused Parser and EntityTagger HOT 2
- Trie's `max_threshold` is documented as int, seems to be float
- `ZeroDivisionError` in determine_intent when tags are empty HOT 1
- An issue with adapt-parser. Adding new intents is breaking old behavior. HOT 3
- Adapt react-native HOT 2
- Add license and test files to PyPI packages HOT 2
- Consolidate package requirements HOT 4
- Tooling for debugging Adapt
- Improve the readability of Adapt
- AttributeError when re-registering regex
- IntentDeterminationEngine.determine_intent does not return sorted results
- Github Action: Fix exit status
- Regex entities with optional words HOT 6
- tokenize voice input? HOT 2
- Possible bug in context merging in context.py HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from adapt.