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

Added new intent: Change Temperature #75

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions data/nlu.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,20 @@
- hello
- hi

## intent: time
- time
- what's time now
- time please

## intent: Convert time
- 13 EDT Monday to GMT
- 2 CST Wednesday to IST
- 11 GMT Thursday to IST
- 23 IST Friday to EDT
- 5 GST Monday to CST
- 9 PDT Sunday to IST


## intent:quote
- quote
- random quote
Expand All @@ -30,6 +44,26 @@
- flip a coin
- flip again

# intent: length unit conversion

- 10 centimeter to inche
- 100 meter to yard
- 1000 centimeter to meter
- 50 inche to millimeter
- 200 nanometer to meter
- 20 square meter to square centimeter
- 100 squard mile to
- 100 cm to inches
- 10 kg to lbs
- 100 mm to inches
- 20 meters to feet
- 1000 km to miles
- 200 cm to feet
- 100 meters to yards
- 10 feet to cm
- 10 feet to inches
- 100 square feet to acres

## intent:fact
- fact
- random fact
Expand All @@ -50,3 +84,11 @@
- tell me a joke
- one more joke

## intent:change temperature
- 100 celsius to fahrenheit
- 50 rankine to celsius
- 75 kelvin to centigrade
- 10 fahrenheit to rankine
- 85 centigrade to celsius


43 changes: 43 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,27 @@ def extract_structured_data(query):
'intent': 'hello',
'entities': []
},
{
'input': 'What is time now',
'intent': 'time',
'entities': [{
'timing':[{'value': 'time'}],

}]

},
{
'input': '2 CST Wednesday to IST',
'intent': 'Convert time',
'entities': [
{
'timing': [{'value':'2'}],
'from_timeZone': [{'value':'CST'}],
'day' : [{'value': 'Wednesday'}],
'to_timeZone': [{'value':'IST'}]
}
]
},
{
'input': 'show me a quote',
'intent': 'quote',
Expand All @@ -65,6 +86,17 @@ def extract_structured_data(query):
'intent': 'coin',
'entities': []
},
{
'input': '100 meter to yard',
'intent': 'length unit conversion',
'entities': [
{
'digit': [{'value':'100'}],
'from_unit': [{'value':'meter'}],
'to_unit': [{'value':'yard'}]
}
]
},
{
'input': 'tell me a fact',
'intent': 'fact',
Expand All @@ -80,6 +112,17 @@ def extract_structured_data(query):
'intent': 'joke',
'entities': []
},
{
'input':'100 celsius to fahrenheit',
'intent':'change temperature'
'entities':[
{
'temperature': [{'value':'100'}],
'from_temperature': [{'value':'celsius'}],
'to_temperature': [{'value':'fahrenheit'}]
}
]
},
]

for query in queries:
Expand Down