IBM Watson Knowledge Studio - Annotating negative / negated mentions - watson

When annotating mentions using Watson Knowledge Studio, one often has examples such as:
"I received no feedback from in response to ..." or "I have never received any feedback".
If I were to annotate the mention "feedback" in the above, it is an "negative" example, i.e. it refers to something that did not happen. There are two possibilities when creating a custom entity type system:
(a) Include the negator in the mention, i.e. "no feedback" is the mention. This clearly does not work in the second example, since there is no negator before the work feedback.
(b) Do not include the negator in the mention, but add an attribute to the mention using the mention class NEG (https://www.ibm.com/watson/developercloud/doc/wks/wks_t_ts_intro.shtml)
Clearly option (b) is the more general approach. However, once a model is trained one needs to be able to extract entities unseen examples. For this you have to use the Natural Language Understanding API (https://www.ibm.com/watson/developercloud/doc/natural-language-understanding/#entities).
When one uses this API, there doesn't seem to be a way to extract the mention attributes, i.e. when I do entity extraction, how do I see that a mention is negated or not, since using approach (b) you do not include the negator as part of the mention?

as I mentioned here IBM Watson Knowledge Studio - Entities with Role attribute and extracting it from NLU api currently mention attributes such as negation are not extractable in NLU.

Related

Watson knowledge studio Custom Model returns only few relations where I have annotate multiple relations?

I am working on Watson Knowledge Studio and build a custom model on it but I have declared many relations for my documents and my every document is different from another .....after that, I have successfully deployed the model on NLU .. but it returns very few relations. Is there any limit for returning relations.
If you have not manually specified any limit, you could check your annotations to see why you are getting poor performance. You can check how many relation types you have annotated and if you have given sufficient examples for each relation type. A very complex system is likely to perform poorly, as the back-end contains a ML model which tries to learn from training data. You may consider experimenting by simplifying your type system, with fewer types and sufficient examples for each type.

Watson conversaton with Visual Recognition

Im working on a project that involves facial expressions, my question is, is it possible to use Watson conversation to guide the conversation based on the facial expression ie: sad, happy, angry.
For example if your expression is sad, watson conversation must lead the convo to make you feel better etc..
Yes it is possible - you can make Watson conversation follow any logic which you define in your application (including the scenario with emotions) by means of using context variables.
(see more under: https://console.bluemix.net/docs/services/conversation/develop-app.html#building-a-client-application)
The high level idea is:
your application is attached to a service which provides current emotion of the user
when interacting with Watson the application puts this emotion as a variable into context of the conversation.
you use this variable in conditions of dialog nodes in order to control where the conversation goes depending of the user mood
More specific implementation details will vary depending on how/when you fetch user emotions.

Does it make sense to interrogate structured data using NLP?

I know that this question may not be suitable for SO, but please let this question be here for a while. Last time my question was moved to cross-validated, it froze; no more views or feedback.
I came across a question that does not make much sense for me. How IFC models can be interrogated via NLP? Consider IFC models as semantically rich structured data. IFC defines an EXPRESS based entity-relationship model consisting of entities organized into an object-based inheritance hierarchy. Examples of entities include building elements, geometry, and basic constructs.
How could NLP be used for such type of data? I don't see NLP relevant at all.
In general, I would suggest that using NLP techniques to "interrogate" already (quite formally) structured data like EXPRESS would be overkill at best and a time / maintenance sinkhole at worst. In general, the strengths of NLP (human language ambiguity resolution, coreference resolution, text summarization, textual entailment, etc.) are wholly unnecessary when you already have such an unambiguous encoding as this. If anything, you could imagine translating this schema directly into a Prolog application for direct logic queries, etc. (which is quite a different direction than NLP).
I did some searches to try to find the references you may have been referring to. The only item I found was Extending Building Information Models Semiautomatically Using Semantic Natural Language Processing Techniques:
... the authors propose a new method for extending the IFC schema to incorporate CC-related information, in an objective and semiautomated manner. The method utilizes semantic natural language processing techniques and machine learning techniques to extract concepts from documents that are related to CC [compliance checking] (e.g., building codes) and match the extracted concepts to concepts in the IFC class hierarchy.
So in this example, at least, the authors are not "interrogating" the IFC schema with NLP, but rather using it to augment existing schemas with additional information extracted from human-readable text. This makes much more sense. If you want to post the actual URL or reference that contains the "NLP interrogation" phrase, I should be able to comment more specifically.
Edit:
The project grant abstract you referenced does not contain much in the way of details, but they have this sentence:
... The information embedded in the parametric 3D model is intended for facility or workplace management using appropriate software. However, this information also has the potential, when combined with IoT sensors and cognitive computing, to be utilised by healthcare professionals in Ambient Assisted Living (AAL) environments. This project will examine how as-constructed BIM models of healthcare facilities can be interrogated via natural language processing to support AAL. ...
I can only speculate on the following reason for possibly using an NLP framework for this purpose:
While BIM models include Industry Foundation Classes (IFCs) and aecXML, there are many dozens of other formats, many of them proprietary. Some are CAD-integrated and others are standalone. Rather than pay for many proprietary licenses (some of these enterprise products are quite expensive), and/or spend the time to develop proper structured query behavior for the various diverse file format specifications (which may not be publicly available in proprietary cases), the authors have chosen a more automated, general solution to extract the content they are looking for (which I assume must be textual or textual tags in nearly all cases). This would almost be akin to a search engine "scraping" websites and looking for key words or phrases and synonyms to them, etc. The upside is they don't have to explicitly code against all the different possible BIM file formats to get good coverage, nor pay out large sums of money. The downside is they open up new issues and considerations that come with NLP, including training, validation, supervision, etc. And NLP will never have the same level of accuracy you could obtain from a true structured query against a known schema.

spell checker uses language model

I look for spell checker that could use language model.
I know there is a lot of good spell checkers such as Hunspell, however as I see it doesn't relate to context, so it only token-based spell checker.
for example,
I lick eating banana
so here at token-based level no misspellings at all, all words are correct, but there is no meaning in the sentence. However "smart" spell checker would recognize that "lick" is actually correctly written word, but may be the author meant "like" and then there is a meaning in the sentence.
I have a bunch of correctly written sentences in the specific domain, I want to train "smart" spell checker to recognize misspelling and to learn language model, such that it would recognize that even thought "lick" is written correctly, however the author meant "like".
I don't see that Hunspell has such feature, can you suggest any other spell checker, that could do so.
See "The Design of a Proofreading Software Service" by Raphael Mudge. He describes both the data sources (Wikipedia, blogs etc) and the algorithm (basically comparing probabilities) of his approach. The source of this system, After the Deadline, is available, but it's not actively maintained anymore.
One way to do this is via a character-based language model (rather than a word-based n-gram model). See my answer to Figuring out where to add punctuation in bad user generated content?. The problem you're describing is different, but you can apply a similar solution. And, as I noted there, the LingPipe tutorial is a pretty straightforward way of developing a proof-of-concept implementation.
One important difference - to capture more context, you may want to train a larger n-gram model than the one I recommended for punctuation restoration. Maybe 15-30 characters? You'll have to experiment a little there.

Interviewer asks: "What's the value of dependency injection?" [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
What is dependency injection?
I respond: "You don't need to use the new operator."
Interviewer's response: "<SIGH>. That's it?"
That's all I could come up with.
What would have been a more correct response if that is not correct?
It decouples a component from its external dependencies (e.g. other libraries, databases, etc.) allowing you to easily change them - even at runtime.
This can (for example) be useful in automated testing as you can inject mock objects via the public API.
Dependency injection decouples classes from the services they depend on, allowing you to register a set of services once and use them throughout your codebase.
This allows you to switch implementations non-intrusively, especially if the implementations are unit-tested.
It also allows you to put different service implementations with the same classes for different use-cases, such as web vs. GUI vs. testing.
The wikipedia article is a good reference: http://en.wikipedia.org/wiki/Dependency_injection.
Mainly, it reduces coupling and eases testing. You can conveniently unit test the class just by feeding it a mock instead of the real class. It's a good question in interviews to see if the candidate is familiar with TDD good practises.
Rather than thinking in terms of the words "dependency injection", think "list of factories". To use a real-world example, think of a catalog supply firm with thousands of different products. It would like to use a common scheme for keeping objects in inventory and reordering them when empty. It would be hard to run such a business if every product had its own independent means of ordering, and there had to be one person who knew how to order every product. That's not how businesses operate, however. Instead, there will be a file which contains for each product the information and procedures necessary to order it. Many products would use the same procedures, but a few products might require special procedures (e.g. call 815-555-6666 between 2pm and 3pm, ask for Steve, and ask him for widgets with blue end-caps, since the company normally puts on yellow end-caps).
Think of dependency injection as being the ability to include procurement instructions within the list of product types. Think of how smoothly the catalog firm can run with such ability, and how awkward it would be to have a firm of any size without it.
PS--"Dependency injection", like "Resource Allocation Is Initialization", is a phrase I dislike because its practical meaning has little to do with the words that comprise it. Most uses of DI don't seem to have much to do with "dependency", nor with "injecting" anything. I think "list of factories" is a word longer (but syllable shorter) and conveys the meaning much better. Incidentally, for RIAA, I'd substitute "object lifetime matches object scope".

Resources