Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No TimeInterval slot for "next hour" #884

Open
tadly opened this issue Aug 15, 2020 · 0 comments
Open

No TimeInterval slot for "next hour" #884

tadly opened this issue Aug 15, 2020 · 0 comments
Labels

Comments

@tadly
Copy link

tadly commented Aug 15, 2020

Describe the bug

Using "next hour" in a sentence does not return a TimeInterval slot like "next one hour" does.
This is true when using snips/datetime or snips/timePeriod.

The following example only focuses on snips/timePeriod though.

To Reproduce

import json

from snips_nlu import SnipsNLUEngine, load_resources


def test_snips(phrase):
    data = {
        'language': 'en',
        'entities': {
            'snips/timePeriod': {}
        },
        'intents': {
            'weather.will_rain': {
                'utterances': [{
                    'data': [{
                        'text': 'Will it rain in the '
                    }, {
                        'text': 'next two hours',
                        'slot_name': 'date_time',
                        'entity': 'snips/timePeriod'
                    }]
                }]
            },
            'weather.will_snow': {
                'utterances': [{
                    'data': [{
                        'text': 'Will it snow in the '
                    }, {
                        'text': 'next hour',
                        'slot_name': 'date_time',
                        'entity': 'snips/timePeriod'
                    }]
                }]
            }
        },
    }

    engine = SnipsNLUEngine(resources=load_resources('snips_nlu_en'))
    engine.fit(data)

    parsing = engine.parse(phrase)
    print(json.dumps(parsing, indent=2))


# Works as expected
test_snips('Will it rain in the next one hour?')

# Doesn't work
test_snips('Will it snow in the next hour?')

Expected behavior

I would expect a TimeInterval slot just like I get for ...in the next one hour?

Environment:

  • OS: Linux
  • python version: 3.8.5
  • snips-nlu version: snips-nlu==0.20.2, snips_nlu_en-0.2.3
@tadly tadly added the bug label Aug 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant