SJSUFall2019-CMPE272 / swift

Slack plug-in application to automatically send messages between company departments.
0 stars 1 forks source link

Does swift really need NER and if yes, is Stanford NER a good choice? #1

Open vaswal opened 4 years ago

vaswal commented 4 years ago

Technology choice issue -

  1. NER is a subtask of information extraction that seeks to locate and classify named entity mentions in unstructured text into pre-defined categories such as the person names, organizations, locations, medical codes, time expressions, quantities, monetary values, percentages, etc.

  2. Stanford NER can only support 7 classes - Location, Person, Organization, Money, Percent, Date, Time

Source: Stanford Named Entity Recognizer (NER)

  1. If we look at the above 7 classes and try to find which ones can be used for routing, only two classes seem like good candidates - Person, Organisation and maybe Location. Money, Percent, Date, Time can be used to extract information.

  2. a) But if the user already knows the name fo the person, won't the user directly send an email to the concerned person by looking up the person's name in the organization's directory?

b) From the description of swift, "extract relevant details from employee messages and forwards them to the appropriate department", it appears that it is supposed to work within an organization. So, the user messages to swift will rarely contain the name of another organization. For example, one won't see a Google employee trying to get his payslips from Apple's HR system.

c) That leaves swift only one class, Location, which can be used for forwarding. But, can it be? For example, in the user message - "How can I book flight tickets for my meeting in New York?", Stanford NER would extract "New York" as a location, but how will swift use the extracted information to forward the user message to the company's Travel Department?

  1. Let's assume swift receives the following two messages from User 1 and User 2 respectively - a) "My printer stopped working and I have tried restarting it many times" b) "What is the process to apply for maternity leave?"

  2. What entities would swift extract from the above two messages (5.a and 5.b) using Stanford NER? It appears that none of the 7 classes supported by Stanford NLP are present in the above two messages and hence Stanford NER would result in an empty set.

  3. If yes, how will swift handle empty set results from Stanford NER? Is it going to perform text lookup?

  4. How will swift perform text lookup? Will swift use a mapping between text, for example, "maternity leave" to departments and/or teams, for example "HR department"?

  5. If yes, how will swift generate these mappings? Will swift manually create these mappings or will it automatically generate them from some dataset?

  6. If swift automatically generates the mappings from some dataset, what algorithm will it use?

  7. If swift uses a hardcoded text lookup mapping approach, how will it handle the many different variants of a user query? For example, all the below user messages are valid variations of 5.b a) "I am going to have a baby, how do I apply for leave?" b) "I am pregnant, how do I apply for leave" c) "How do I apply for childbirth leave"

mdhsieh commented 4 years ago

Stanford NER does have the 7 classes, but it is also possible to train an NER classifier using a more company-related dataset. This would allow more specific and relevant classes to be available. The app is meant to work in a single organization, on company-related issues. Swift can automatically perform text lookup mapping the text with the department, using the trained dataset. We can train the NER classifier on company messages that are already labeled, which will have different sentence structures. Stanford NER and others have their own train() method. The mapping is not supposed to be hardcoded. If there is an empty set, one solution is the app can make its best guess and inform the support team to confirm and further improve the model. Order usually doesn’t matter as much in NER since it is taking important pieces from the entire message.