Can luis recognize city and country depending on build in geography intend? - azure-language-understanding

Currently training my LUIS application.
LUIS is connected with bing. LUIS has a lot of build in intents.
So, my question is:
Does the build in geography intent recognize city or country is my input and get the entity about?
For example:
forecast about georgia -- this is country
forecast about munchen -- this is city

Yes, you can differentiate between cities, countries, or points of interest using the entity type:
{ "type": "builtin.geography.city", "entity": "paris" }
{ "type": "builtin.geography.country", "entity": "australia" }
{ "type": "builtin.geography.pointOfInterest", "entity": "sahara desert" }

Related

ElasticSearch: index document correctly and create correct search request

I apologize for my silly question, but as always being a newbie to some new SW stack it is hard to find an exact answer quickly. So please help.
Question 1:
I have many documents of the following shape. Quite simple, description of a company and some products that a company offers. The question is how to post this document into elasticsearch(ES)? Because nested structures have some important sense, but ES does not eat it as is.
Question 2:
It is about search request itself. I need to search through all such documents looking for appropriate phrase in the field "description" and also looking for particular type of products.
For example, I need to find all companies with description which includes phrase "South Africa", which offer fruits and in the same time offer only onions from vegetable category.
Field "description" is just text. When everything is under products is pre-defined known lists. There are can be many many different categories and names under categories.
What could be search request in such case?
{
"description": "The best goods from Africa",
"products": [
{
"category": "fruits",
"name": [ "oranges", "cocos" ]
},
{
"category": "vegetables",
"name": [ "cabbage", "cucumbers", "onion" ]
},
...
]
}

In the Google Calendar API, how do I determine if a calendar is google-created calendar, or a user-created worskpace calendar

I need a way to distinguish a google-created calendar (ex. "Holidays in United States") from a user-created calendar (ex. "Engineering Department") in the Google Calendar API. There doesn't seem to be a distinct field for this, so I've been trying to find a pattern in the calendar's fields. From the CalendarList API:
{
...
"items": [
{
"kind": "calendar#calendarListEntry",
"etag": "\"1616104281883000\"",
"id": "en.usa#holiday#group.v.calendar.google.com",
"summary": "Holidays in United States",
"description": "Holidays and Observances in United States",
...
},
{
"kind": "calendar#calendarListEntry",
"etag": "\"1623344030696000\"",
"id": "c_g3s8ze0hkg2mc6kabr33f6r0ro#group.calendar.google.com",
"summary": "Engineering Department",
...
}
]
It seems like the only differentiating pattern is in the structure of the id field. The Google-created calendars have a readable email username, and the email domain is group.v.calendar.google.com. The user-created calendar on the other hand has a seemingly random string of characters as the username, and the email domain is group.calendar.google.com (notice the .v is missing).
This is a single example, but from the other examples I've seen the pattern is consistent. I haven't been able to find this pattern explicitly stated anywhere in the Google Calendar API docs, but maybe I'm missing something. Is this pattern explicitly stated anywhere? Or am I going about this wrong, and should be using a different feature of the API to distinguish these cases?

Is it possible to tell luis to extract an specific value from a given text?

i want to create an chat bot which can track packages (and many things more). I'm kinda new to all these intents and entities things. My goal to achive is that if i say to the chatbot "track the package [PACKAGEID]" or "could you please find [PACKAGEID] for me?" and than luis should return the intent and the [PACKAGEID]. Is this possible? Or if not, is there something else i can use (best would be if this is from microsoft, because of business stuff... yay)
kind regards,
me.... hey!
To achieve your requirement, you can try the following steps:
1)Add a simple entity named PackageID
2)Add a phrase list for PackageID(s)
3)Add a intent named FindPackage and add some example utterances, and then label entity in utterance.
4)Train (and publish) the app
Test result:
Note:
I'm kinda new to all these intents and entities things.
You can get more information about key concepts of LUIS app in LUIS documentation.
If you know all possible formats of the "PACKAGEID" then you may use Entity of type "Regex"
1) click at
2) Create Regex definition. Example below matches all PACKAGEID-s
starting by "KQ" then followed by 8 to 10 numbers, ending by "DE"
3) If you try sentence "could you please find kq123456789de for me?" then you get following result
{
"query": "could you please find kq123456789de for me?",
"topScoringIntent": {
"intent": "Status",
"score": 0.9369452
},
"intents": [
{
"intent": "Status",
"score": 0.9369452
},
...
],
"entities": [
{
"entity": "kq123456789de",
"type": "PACKAGEID",
"startIndex": 22,
"endIndex": 34
}
]
}

how to plot non linear data in dc.js

I have a json data file with a structure that is kind of complicated, something like that:
[
{
"patient_id": "f1ff9870",
"demographics": {
"gender": "female",
"age": 78
},
"measurements": [
{
"unit": "bpm",
"kind": "pulse",
"value": "130",
"measurementDate": "2017-05-04 03:00:00+03"
}
],
"problems": [
{
"name_title": "problem1",
"category": "Primary disease",
"startDate": "2017-05-12 03:00:00+03"
},
{
"name_title": "problem2",
"category": "Primary disease",
"startDate": "2017-05-12 03:00:00+03"
}
]
},
{
"patient_id": "c9047712",
"demographics": {
"gender": "male",
"age": 60
}
}
]
each object is a patient who can have several fields, some of them are arrays, and not all the patients have the same number of fields.
I am trying to find a way to use the crossfilter and make the groups for the plots but I am not really close to a solution. I want to use charts, for each field(i.e. problems, age etc), and each one should be a filter. So, if i select a specific problem i will be able to see how many patients have that problem, their age, measurements etc. Is there a way to work around non linear data?
This is a broad question. Let me address this specific part of it:
if i select a specific problem i will be able to see how many patients have that problem, their age, measurements etc.
"Problems" can be thought of as a tag or array dimension.
So you could aggregate problems and age like this:
var cf = crossfilter(data);
var problemsDim = cf.dimension(d => d.problems.map(p => p.category), true);
var ageDim = cf.dimension(d => d.demographics.age);
var problemsGroup = problemsDim.group(); // default is "reduceCount"
var ageGroup = ageDim.group();
Now when you select a specific problem you'll see counts of all patients who have that problem. When you select a specific age, you'll get a count of all patients who have each problem.
Note that with tag dimensions, the total of all the counts will usually add up to more than the number of records.
You could do something similar for measurements. Of course some patients may not have problems or measurements, so they wouldn't show up in those charts. Also you might end up with weird results if a patient had more than one of the same measurement.

FHIR Questionnaire - questions order

In my application I want to use FHIR Questionnaire resource.
On the server side I am trying to generate questionnaire with different types of questions and send it to the application where user (patient) can fill in answers and send them back.
However in some cases I would like from user to answer only specific questions of the questionnaire and not all of them. For example if questionnaire consists of two questions:
Do you smoke or drink alcohol?
Measure your heart rate.
I would like that user answers second question only if he has answered on the first question with 'yes'. The second question is skipped if he has answered 'no'.
The problem is that I do not know how to add these rules, which will tell which question is next, inside the Questionnaire resource.
I came along to some extensions like ordinalValue, but I couldn't find out how/where to use them and where to define if user's answer must be equal / less / greater than some value.
So I would like to know which extension i need to use (and how) to achieve what I've written before? Is this even possible with existing extensions or I would have to define a new one?
I am adding simple representation (with only relevant data) of mentioned questionnaire in the JSON form:
{
"resourceType": "Questionnaire",
...
"item": [
{
"linkId": "1",
"text": "Do you smoke or drink alcohol?",
"type": "boolean"
<< ??? extension ???>>
},
{
"linkId": "2",
"text": "Measure your heart rate.",
"type": "integer"
}]
}
You could use the Questionnaire.item.enableWhen element for this:
{
"linkId": "2",
"text": "Measure your heart rate.",
"type": "integer"
"enableWhen": [{
"question": "1",
"answerBoolean": "true",
}
],
}

Resources