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?
Describe the bug
Using "next hour" in a sentence does not return a
TimeInterval
slot like "next one hour" does. This is true when usingsnips/datetime
orsnips/timePeriod
.The following example only focuses on
snips/timePeriod
though.To Reproduce
Expected behavior
I would expect a
TimeInterval
slot just like I get for...in the next one hour?
Environment:
3.8.5
snips-nlu==0.20.2
,snips_nlu_en-0.2.3