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

Entities not recognized correctly #42

Closed
ibrahiminfinite opened this issue Apr 21, 2019 · 1 comment
Closed

Entities not recognized correctly #42

ibrahiminfinite opened this issue Apr 21, 2019 · 1 comment

Comments

@ibrahiminfinite
Copy link
Contributor

ibrahiminfinite commented Apr 21, 2019

from eywa.nlu import EntityExtractor
ex = EntityExtractor()
# entities : intent , source , destination, nop(number of passengers), time, date
x_taxi = [
          'get me a cab from Aluva to kakkanad for 2 at 2am today',
          'find me a txi from manglore to mumbai for 5 at 6pm tommorow',
          'book a cab to newyork for 5',
          'find a taxi from akihabara to yokohama'
         ]
y_taxi = [
          {'intent': 'cab_booking', 'source': 'Aluva', 'destination': 'kakkanad', 'nop': '2', 'time': '2am', 'date': 'today'},
          {'intent': 'cab_booking', 'source': 'manglore', 'destination': 'mumbai', 'nop': '5', 'time': '6pm', 'date': 'tommorow'},
          {'intent': 'cab_booking', 'source': None, 'destination': 'newyork', 'nop': '5', 'time': None, 'date': None},
          {'intent': 'cab_booking', 'source': 'akihabara', 'destination': 'yokohama', 'nop': None, 'time': None, 'date': None}
         ]

ex.fit(x_taxi, y_taxi)

x_test = 'get me a taxi from chennai to banglore for 2 at 2am today'
res = ex.predict(x_test)
print(res)
@ibrahiminfinite
Copy link
Contributor Author

Fixed in commit 7cf4811 with eywa.nn.NNPicker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant