how to map dynamic input with entity in watson conversation (Bluemix) - ibm-cloud

I am trying to make a chat bot which can answer some of my questions like :-
"i need to know about birds like sparrow, peacock, parrot or i need to know about bird sparrow.".
Birds names would be dynamic entry here and user can ask about any bird name and any list of bird name, all this should be dynamic.
So how would i map single bird name or list, with entity dynamically?

Watson Assistant has an API that allows to manage (create, delete, update) entities. That could be used to dynamically add bird names as values to an existing entity bird. Note that cognitive systems need to be trained to correctly identify patterns, e.g., bird names.
Detected bird names would be flagged in the response object. How do you plan to react to them? You could use that in a dialog and use dialog actions to look up details for the specific bird or the birds in the list.

Related

#sys-person is depreciated, how can I create a name entity for slots?

IBM Watson Assistant is depreciating the #sys-person entity for some reason. I use it a lot in my slots to capture the name.
How can I create an entity that would do the same thing to replace #sys-person?
If you are using a supported language, use annotation-based entities.
The tutorial on how to create a database-driven Slackbot uses that method for locations (#sys-location is deprecated, too). Load the provided skill and see how it is done.
Basically, you create an entity and then go to intent examples and tag the parts which identify a person. Then, Watson Assistant is learning that you expect a person entity in specific sentencens and sentence positions. You can fine-tune it by running some dialogs and correct the falsely identified or missing person entity values.
I use the same technique as replacement for #sys-location and it works for me in slots. Even "San Francisco" is recognized as one location. I added it as sample. You can tag entities across intents.
If you don't want to go that route, the only solution I am aware of is to define an entity, e.g., my-person with many examples and use that.

Watson: Dialogs. Are they required?

We are working on a micro-service that interacts with Watson.
I was presented with the following argument: "There is no need to use dialogs in a Conversation project on Watson. Declaring the intents and entities is just enough to get the work done"
Based on the documentation, I have the impression that using dialogs is a requirement in order to train Watson correctly on how to interpret the combination of intents and entities. Plus, in the Dialog section, you have the chat that allows you to make corrections.
Is there a way that I can confirm that Dialogs are or are not a requirement?
If you plan to just use intents and entities programmatically then you don’t need dialog.
You will need to create one blank dialog, with a condition of true. This is to avoid SPEL errors relating to no node found.
From a programming point of view (and ignoring conversation for a minute), if you need to take action on intents, entities, or change context variables. The recommendation is to do that in dialog. This way your code is not split across two systems, making it easier to maintain.
Probably in this phrase above, the author wants to say that you only need to create #intents and #entities for your Conversation and defining the purpose for your bot, this is true, depends on what you want to do in your bot, cause after it you can just create your dialog flow!
The Dialog section is for you create your Dialog flow, is absolutely needed when you want to create one conversation flow, e.g: one chatbot.
A workspace contains the following types of artifacts:
Intents: An intent represents the purpose of a user's input, such as a
question about business locations or a bill payment. You define an
intent for each type of user request you want your application to
support. In the tool, the name of an intent is always prefixed with
the # character. To train the workspace to recognize your intents, you
supply lots of examples of user input and indicate which intents they
map to.
Entities; An entity represents a term or object that is relevant to
your intents and that provides a specific context for an intent. For
example, an entity might represent a city where the user wants to find
a business location, or the amount of a bill payment. In the tool, the
name of an entity is always prefixed with the # character. To train
the workspace to recognize your entities, you list the possible values
for each entity and synonyms that users might enter.
Dialog: A dialog is a branching conversation flow that defines how
your application responds when it recognizes the defined intents and
entities. You use the dialog builder in the tool to create
conversations with users, providing responses based on the intents and
entities that you recognize in their input.
EDIT:
Likes #Simon O'Doherty said, if your purpose is to just use the Intents and Entities programmatically, then you don't need the Dialog. His answer is complete.
See the documentation for Building a Dialog.
Yes Intents and Entities may seem to be just enough for you, and you can generate the answer - programmatically - based on them. But you should keep in mind that Dialog does not mean Response. I know it's hard to find this clearly in Watson documentation.
If you need to get access to context variables in the next node or dialog, you should define them in slots. Without defining dialogs for each intent, context variables will not be accessible or conveyed in the next dialog.
You need Dialog portion of Watson Conversation service if you want to respond to the user queries.
The Intents and entities are the understanding piece, and the Dialog portion is the response side of the conversation.

How can I represent pages that are game levels in Schema.org?

I'd like to add Schema.org (with Microdata) to a browser-based game. The entire website would be considered a VideoGame, so it seems appropriate to mark up each page as a VideoGame in the <html> tag and label the "Home" link with sameAs property.
However, there are individual pages for each puzzle level (each "system"), as well as pages for collections of levels ("clusters"). How do I mark these up? gameLocation and gameItem are both vaguely equivalent properties, but are not good matches. I would love to be able to make each System and Cluster its own item instead of just a property of the parent VideoGame.
How do I represent individual levels of a game on each level's page?
Instead of using the sameAs property to link from each occurence of the VideoGame entity to the game’s homepage, you could give your game a URI and use this URI as identifier for each entity.¹ The url property could be used to link to the game’s homepage. The sameAs property could be used to link to a Wikipedia page etc. about the game.
The VideoGame entity represents the whole game, gives metadata about the game, etc., but this type itself is not meant to represent specific parts of your game.
If using its gameLocation property, you do have an own item (e.g., Place). The same with the gameItem property (e.g., Thing). These are properties of VideoGame because otherwise there would be no relation between the game and the locations/items it contains. Of course you could have a Place/Thing as top-level item and use the reverse² properties to reference the VideoGame, but that’s just an implementation detail, it doesn’t change the data.
However, Schema.org’s focus is of course not on video games, so most game content can’t be represented adequately. For example, gameLocation might not really be appropriate for puzzle game levels, unless e.g. a game character actually visits a puzzle in the game.
If you want to provide more detailed structured data about your game content, you’d have to use a different, ideally game-focused, vocabulary (and/or wait for or suggest a Schema.org extension).
¹ Microdata: itemid / RDFa Lite: resource / JSON-LD: #id
² No standard way in Microdata (itemprop-reverse proposed) / rev in RDFa (not RDFa Lite) / #reverse in JSON-LD

Associating open graph action with multiple objects & caption template

Currently I am building a site with a Facebook Open Graph integration.
One complication I have is since user can do seemingly similar actions to different objects on our site, it is easy for us to define different action for each similar actions. However, it seems like Facebook is not allowing ( or at least not liking ) for one site to have multiple similarly looking actions.
For instance, let's assume that user can both 'buy' a car, and 'buy' an insurance in our site.
Although, on surface, these two action look similar, because their context is different we want to show different content - more specifically different caption - for each action that is postsed.
Simple way to implement this will be defining two actions,
'BuyCar' <---> associated with Car
'BuyInsurance' <---> associated with Insurance
and let them have distinctive caption template.
However, as I mentioned earlier, since Facebook does not allow multiple similar actions to be defined within a site, I should be defining.
'Buy' <----> associated with [Car, Insurance]
where this action always have only one property defined. (either Car or Insurance)
Downside of having these type of action is, due to limitation in current cation's template language (lacks conditional statement), I am not able to produce different caption effectively without knowing which property is set.
How should I be handling this issue?
Your help will be greatly appreciated.
Thanks
I think the captions do need to be something generic that will work for all connected object types. But you could use filters to defined separate aggregations for each object type.
Just add an additional parameter to all of your objects and set the value of that parameter as an aggregation filter?

Developing a very nonstandard Drupal form

I'm creating a site for a local retail shop using Drupal. Everything's been going very smoothly up until this current bit.
It's a comic shop, and I want to make a place where people can manage their own subscriptions. Since the number of different titles a customer subscribes to can vary pretty widely, I want a way to make a completely dynamic form, with people able to add as many new lines as they need and I'm really struggling with Drupal's documentation.
Essentially, I'd like the final version of the page to look something like this: http://www.monksp.org/foo.html
Anyone have any experience building a drupal form like this?
Could you not achieve something similar using Taxonomy and free tagging? Take a look at http://drupal.org/handbook/modules/taxonomy
So in theory you would have a content type called "Subscription", each user would only be able to create one node of this type, it would have the taxonomy applied to it. The user can then edit the node and add more subscriptions. The great thing about this is that you can also use auto-complete. So say a user is already subscribed to X-Men another user can edit their subscription and start typing "X" this would then auto populate with suggested terms already in the taxonomy. e.g:
X-men: Origins
X-men: Apocalypse Saga
X-men: Noir
I think this is the functionality you've described.