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

QA enhancements #144

Closed cameron-toy closed 4 years ago

cameron-toy commented 4 years ago

Improved question parsing "metalanguage" to support questions involving a list of answers ("What sections does [PROF] teach?")

Answer format syntax:

Special tokens are in square brackets [] and have key words separated by two periods

ENTITY can be PROF, COURSE, CLUB, or SECRET_HIDEOUT

[ENTITY] will be substituted with the name of the extracted entity.

[PROF] -> "Khosmood"

[ENTITY..PROPERTY] will be substituted with the property of that entity from its main table in the database

[PROF..email] -> foaad@calpoly.edu

[ENTITY..PROPERTY..TABLE] will search for that entity in a different table. Currently, this isn't super useful, but TABLE can be any ENTITY or PROF_SECTION to search in the sections table.

[ENTITY..PROPERTY..JOINER] will find all matches to ENTITY in its default table, make a list of the matching PROPERTY, and grammatically join them with JOINER.

JOINER will pretty much always be "and" or "or", and when I say "grammatically join" I mean join like:

["CPE 202"] -> "CPE 202" ["CPE 202", "CPE 203"] -> "CPE 202 and CPE 203" ["CPE 202", "CPE 203", "CPE 357"] -> "CPE 202, CPE 203, and CPE 357"

TABLE can be any of the ENTITY types, as well as PROF_SECTION for section information.

Finally, [ENTITY..PROPERTY..TABLE..JOINER] will find all matches to ENTITY in TABLE, make of list of the matching PROPERTY, and grammatically join them with JOINER.

This lets us answer questions about sections like, "What sections does [PROF] teach?"

[PROF..section_name..PROF_SECTION..and] -> "CSC 491_15, CSC 492_15, CSC 482_01, CSC 378_04, CSC 378_03, CSC 482_02, CSC 400_15, CPE 461_30, and CSC 498_15"

mfekadu commented 4 years ago

just 1 conflict @cameron-toy

image