calpoly-csai / api

Official API for the NIMBUS Voice Assistant accessible via HTTP REST protocol.
https://nimbus.api.calpolycsai.com/
GNU General Public License v3.0
9 stars 4 forks source link

Added the title remover and changed the return tuple to a dictionary … #70

Closed chidiewenike closed 4 years ago

chidiewenike commented 4 years ago

…contain all properties of the nlp pipeline

I added the title remover to remove titles from PROF entities. It also contains a method for removing any other excess words from other entity tags.

The return tuple has also been changed to a dictionary. The format is as follows:

{
                    "entity"                : entity,
                    "tag"                   : tag,
                    "normalized entity"     : normalized_entity,
                    "input question"        : sent,
                    "normalized question"   : normalized_question,
                    "question class":  predicted_question
}

Ex:

{
                    "entity"                : "Dr. Khosmood",
                    "tag"                   : "PROF",
                    "normalized entity"     : "Khosmood" ,
                    "input question"        : "Where is Dr. Khosmood's office?",
                    "normalized question"   : "Where is [PROF]'s office?",
                    "question class": "When are [PROF]'s office hours?"
}

What's New?

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes #<> ... (e.g. #9)

Type of change (pick-one)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration (hardware/operating system/etc).

Checklist (check-all-before-merge)

formatting help: - [x] means "checked' and - [ ] means "unchecked"

cameron-toy commented 4 years ago

Looks good! Really simplifies lots of functions that could be passed to the QA class.

mfekadu commented 4 years ago

nice @chidiewenike ! Dictionaries are the best!!!

good progress toward #65