How to inherit vocabulary in Bixby in a concept used in NL - bixby

I have a concept which has an enum and a vocab. When I inherit this concept in another concept and use in training, the NL fails (but aligned NL works). If I change the vocab to be for the inherited concept, then the NL works.
I would like a single enum concept which has vocab and two child concepts which inherit both the enum and training - the Capsule is for a train schedule so the departure and arrival station use the same vocab and enum

If you extend a type into another capsule, a new vocabulary file must still be created. Vocabulary is never inherited, even if you use extends or add role-of to a model.
You most likely need to use role assignments as described here in the dev docs. This way you can provide Bixby with more context to discern between a departure and arrival station while using the same vocab and enum.

Related

Training model to recognize brands as entities

I'm trying to create a model in LUIS that allow me to detect if a brand (any brand) is mentioned in an utterance. I've tried different approaches but I'm struggling to get it working.
First I have an intent searchBrand with some examples utterances:
'Help me find info about Channel'
'I want to know more about Adidas'
...
What I want is that LUIS recognizes that a brand has been mentioned in the utterance (as an entity).
I believe I have these options:
Use a List Entity: impossible since I would have to fill the list
with every possible brand that exists and, moreover, the user would
have to write the brand exactly as it is, not allowing typos (e.g. ralf
lauren)
Use a ML Entity: I believe this could be the right approach. I've tried the following without success:
Create a ML Entity "brands"
Add a Structure with 1 component "brand"
Add to the component a Descriptor with a list of different brands as an example
Once I label the entities in the utterances, the model recognizes correctly the brands that I added to the Descriptor but it fails to recognize others brands or typos
Another option is a pattern entity. It fits somewhere between the two options you listed. You do need to train it with the patterns, and if the pattern is off at all it will not recognize the entity (and won't recognize the intent either unless you've separately trained it with utterances, which you should). However, it seems like the phrasings in your case would be consistent enough that you could define a few patterns for this, and as you train your bot from endpoint utterances you can add additional patterns as needed. Here is an example:
As I put this together I realized I'm ignoring [help me] and [find], essentially the pattern is "info about {brand}", which may or may not be appropriate depending on your other intents. If you say something different like "Tell me more about Adidas", the intent will be recognized (I trained it with your sample utterances), but the pattern, and therefore entity, will not.
Tutorial on using Patterns in LUIS
I got it working following this:
Create a ML Entity "brands"
Add to the entity a Descriptor with a list of different brands as an example. Remember to normalize the elements in the Descriptor
Add brands to the Descriptor
Label entities as "brands" inside utterances in intent "searchBrands"
Train & test the model
It is very important to normalize everything in LUIS. I had the brands inside the Descriptor capitalized and LUIS couldn't recognize new ones, once I normalized the brands LUIS started suggesting new ones and recognizing more when testing the model

UML dynamic class association

I have a class called pet, which is dynamically associated to either 1 dog or cat but not both at the same time.
What's the name for this type of dynamic association? How can I represent this in a UML class diagram while making it clear that each pet is associated to either one dog or cat but not both at the same time?
Is what you're after simply inheritance? Pet seems to me to be an abstract concept, where as Dog and Cat would be concrete concepts. My initial solution in your situation would probably be to have an abstract Pet class (which cannot be instantiated) which is specialized to Dog and Cat (which can).
If you are really keen to have an instance of a Pet which is associated with an instance of either a Cat or a Dog, then you'd probably have to manage this by inheritance anyway. Something like this perhaps:
The wording of your question is bit funny when reading it as a model of the real world (a domain model).
In the real world, a pet is not associated with an animal. Rather, a pet IS an animal. Consequently, the class pets is a (role) subclass of animals, in a domain model, based on the meaning of the term "pet" in English.
The concept of role classes is not very well supported by mainstream OOP languages. An object may play many roles (that is, instantiate many role classes) at the same time (multiple classification) and it may cease to play a role, that is, cease to instantiate the corresponding role class (dynamic classification).
Maybe you are not interested in making a domain model first, before making a (technology-independent) design model, which you may then turn, e.g., into a Java or C# class model.
Maybe you want to jump to a C++ class model directly, without first trying to understand the underlying domain concepts.
You can do this, but I don't think it's a good idea.

UML, Class identification and relationship

Beginer in UML, I have the followings rules for an Aikido club management:
R1: Every member should participate to the training practices.
R2: The trainees can come from other clubs in the same city or country as well as abroad.
I identify 2 classes:
To take into account the second rule:
Member (1) and Trainee (0..1)
Trainee(1.. *) and Training (1.. *)
Is there a correct way in what I am doing?
Your diagram is a beginning. The diagram as proposed by Thomas Killian is more complete. However, in both of these diagrams there is no notion of constraints or rules. It is simply not what class diagrams are used for. What you can express (with your diagram) is that one or more members can participate in a training and that a training is frequented by at least one member.
To express that every member must participate in training courses, you could need to express that, for all the instances of your class diagram, all members are covered with at least one association towards training. To do so you will need to formulate constraints, possibly using OCL, the Object Constraint Language designed to supplement UML and address the specific shortcomings you are facing now.
Basically this is ok. But the m-n relation between Member and Training should better be modeled as association class:
In this case you are able to add individual properties of members per training. When implementing this you will likely feel the need to introduce some glue (like a table in a database) between both.
I have also added a Club class assuming that a member is bound to just a single club. If you want to model multi-club relations you would probably again use an association class.

Is NER necessary for Coreference resolution?

... or is gender information enough?
More specifically, I'm interested in knowing if I can reduce the number of models loaded by the Stanford Core NLP to extract coreferences. I am not interested in actual named entity recognition.
Thank you
According to the EMNLP paper that describes the coref system packaged with Stanford CoreNLP, named entities tags are just used in the following coref annotation passes: precise constructs, relaxed head matching, and pronouns (Raghunathan et al. 2010).
You can specify what passes to use with the dcoref.sievePasses configuration property. If you want coreference but you don't want to do NER, you should be able to just run the pipeline without NER and specify that the coref system should only use the annotation passes that don't require NER labels.
However, the resulting coref annotations will take a hit on recall. So, you might want to do some experiments to determine whether the degraded quality of the annotations is problem for whatever your are using them for downstream.
In general, yes. First, you need named entities because they serve as the candidate antecedents, or targets to which the pronouns refer. Many (most?) systems perform both entity recognition and type classification in one step. Second, the semantic category (e.g. person, org, location) of the entities are important for constructing accurate coreference chains.

UML Domain Modeling

What is the difference between a domain model and a data model?
A datamodel is a design model that only describes data and it's relations. The model contains entities, but they are described in terms of what data they own not how they act on this data or what their responsibilities are.
An domain model on the other hand, is a conceptual model used in analysis of a problem domain. It describes the domain in terms of entities that have relations, data and behaviour. It describes the responsibilities of those entities as relevant for understanding the problem domain.
BTW an excelent and very short introduction to UML is:
UML Distilled: A Brief Guide to the Standard Object Modeling Language
A data model is focused on the DB schema definition, including tables, columns, and relationships.
A domain model is focused on the business domain, including concepts (classes of objects), behavior (methods/logic), and relationships.
In both cases, the cardinality is used for relationships (e.g. 1:1, 1:Many, 0:Many, ...).
That said, you would ideally like the data model and domain model to be closely related, i.e. a Person with name, ... and a MailingAddress, ... relates to a PERSON table with a NAME column and a FK to a MAILING_ADDR table entry. You have to decide where logic is hosted - in the objects in the software system vs. in the DB via procedures, triggers, and such.
I think it's important to provide some clarity here for posterity.
A data model is a design for how to structure and represent information. By structure, I mean concerns like "fifth normal form". By representation, I mean choosing a computer serialization, such as integer, floating point, or string.
The term domain model actually has two conflated meanings.
A model of essential characteristics of real or imaginary things in the world. In this kind of model, classes represent human conceptualizations and instances are things in the world. For example, a "Person" class would have instances including you and me, and an essential characteristic might be that every Person has a mother. This kind of model is often called an conceptual ontology or concept model and is intended to provide meaning.
A model of required information about things in the world, usually with some system in mind. In this kind of model, classes represent information that must be stored about things in the world. For example, a "Person" class would have instances representing required information about you and me, such as first name, last name, date of birth, current height, and current weight. This information often does not include all essential characteristics, such as our mothers, because, for the purposes of a particular system, that information is not required. This kind of model is often called an information model, conceptual data model, or operational ontology.
Both the UML and OWL languages can be used to represent either kind of domain model. Both can be considered analysis models, as they are used to analyze a domain. One is used to understand things in a domain, the other is used to gather requirements to build a particular software or database system for things in a domain. Both are necessary, and, unfortunately, they are usually conflated such that people building an analysis model are themselves confused about what they are modeling!
I think that domain model and data model are now pretty much the same with new top down modelling technologies. I mean that you can model in a class diagram and only add database stereotypes in your diagram. If you use the tool that I use then your ejb3 annotation would be immediately synchronized with your code. The next step is only to use a mapper to create your database. This technology only works with Java

Resources