GithubHelp home page GithubHelp logo

Comments (6)

clusterfudge avatar clusterfudge commented on June 11, 2024

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.

clusterfudge avatar clusterfudge commented on June 11, 2024

I was able to confirm that the tagger is finding digits. Can you provide some more detail on the structure of your Intents, 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.

whtecmp avatar whtecmp commented on June 11, 2024

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.

clusterfudge avatar clusterfudge commented on June 11, 2024

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.

clusterfudge avatar clusterfudge commented on June 11, 2024

@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.

clusterfudge avatar clusterfudge commented on June 11, 2024

@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)

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.