Watson assistant pattern - watson-conversation

I am creating a dialogue to "make a complaint".
The data to use in this dialog are:
Contract number: it can consist of 10 numbers or numbers and letters (Type : pattern)
Company (Type : entity)
Name: it can be composed of ([A-Za-z àâæçéèêëîïôœùûüÿÀÂÆÇnÉÈÊËÎÏÔŒÙÛÜŸ'- ", ]){1,} (Type : pattern)
First name: it can be composed of ([A-Za-z àâæçéèêëîïôœùûüÿÀÂÆÇnÉÈÊËÎÏÔŒÙÛÜŸ'- ", ]){1,} (Type : pattern)
Object of complaint : paragraph which can contain letters, numbers, characters, spaces, ... (Type : pattern)
After the collection of these data, a question will arise to the customer:
your contract number is $num_contrat, your surname is: $surname your first name is: $first_name your claim is: $obj_reclamation. Do you confirm these data?
If yes, the claim will be recorded in the database. If not, the question that will be asked is: what data do you want to edit ? ...
Until now, my bot detects only the $company because it exists in the company entity and it does not detect $num_contrat, $surname, $first_name and $obj_reclamation.

I would recommend to test your regular expressions with a testing tool. I ran your regexp at: https://regexr.com
It reported the error:
Range values reversed. Start char code is greater than end char code.
Which relates to -.
So your correct regular expression to fix this should be.
([A-Za-z àâæçéèêëîïôœùûüÿÀÂÆÇnÉÈÊËÎÏÔŒÙÛÜŸ'\- ", ]){1,}
But you still have an issue. This is going to match the first full string that is entered. If the person is using slots, you are only going to detect the first word.
You have a few options to resolve this.
1. Use the #sys-name system entity. That will get you a persons name.
2. You can structure your request to ask for their explicit name.
3. You can create a mini form to force them to fill with structured content. Requires UI work.
4. You can create a cloud function to pass it to NLU which you can have return the persons name and company names, etc. I have an example here.

Related

NetSuite System Notes CASE formula returning all notes

I've added a formula(date/time) column to a saved search in NetSuite, to return a system notes' date.
My CASE formula is returning all the system notes row's, and I would like a specific row's date i.e. 'POP Host Int ID' date.
How can I specify the row to return the date from, or remove the rows with no date that are not relevant?
CASE
WHEN {systemnotes.field} = 'POP Host Int ID' AND {systemnotes.type} = 'Set'
THEN {systemnotes.date}
ELSE NULL
END
It appears that my WHEN logic works to identify the record's system notes do contain an entry for 'POP Host Int ID' but in THEN I'm not specifying which row to get the date from so it returns all rows. And I could be wrong on this part.
Example results
Example System Notes for 1 record
Thank you for your assistance.
The CASE statement doesn't determine which rows are returned, only what data is returned for that field. On the other hand, the reference to the systemnotes table creates a join that causes each record result to be repeated for every system note entry.
To avoid this, add {systemnotes.field} = 'POP Host Int ID' and {systemnotes.type} = 'Set' as Filters in the Criteria tab instead of in the WHEN conditions. You can then just add the field under results instead of needing a formula.
Edit in response to comment below:
In cases where you need one result per base record (user), but they don't all have valid values from the joined table (system notes), I'd suggest grouping the results by user, and using aggregation functions for all the columns. EG: For the column in question I'm assuming you are getting one valid result and a lot of blanks per user. If you group by user and set the Summarize function to MAX, you should just get one result where the valid value is returned. If no valid value exists from the system notes, you would still get a result from the user and that field will be blank.
If you are creating a saved search the place to do this is in the criteria section.
The views you've shared are for the System Notes pertaining to a single record.
For those views you could just use the Field selector in the Filters section to select your POP Host Ing ID field.
For a saved search you would use the Advanced view and scroll down the criteria field list. Near the bottom are the System Notes. You can filter on Field, Date etc

Incorrect work of autocomplete with Cyrillic

When sending a request to https://autocomplete.geocode.ls.hereapi.com/6.2/suggest.json?query=Вильнюс with an indication of cyrillic nothing comes and with a latin https: //autocomplete.geocode.ls.heraapi.com/6.2/suggest.json?query=Viln all is well. Tell me what the problem is or what I'm doing wrong?
You're not doing anything wrong. Autocomplete is designed to give you addresses that contain (perfectly match) your input string, and the results are sorted by relevance.
When you make your query in russian and provide only "Вильнюс" as input, the service is finding a lot of results (street names) that it considers are more relevant than the city. The city name is also found, but since the service doesn't think that this is what you're searching for, it puts the city much lower in the results list. You don't see it because you're limiting your query to give you only the first 10 matches (with the maxresults=10 parameter), but if you change the maxresults parameter to 20, for example, you will see that Vilnius appears in the 16th place of the API response.
If you want the service to better understand what is the thing you're querying for, you'll need to provide additional information. For example, if you continue typing and your input string is now "Вильнюс " (with a space at the end) or "Вильнюс Л" (a space and another letter), the service will understand what you mean and will return the result you want.
Another way of providing more information to change the way the service ranks the results is by adding a spatial filter, like the country, mapview, or prox parameters mentioned in the API Reference section of the documentation. Alternatively, the resultType parameter can help you filter out all the results with street names and return only city names, if that's what you want. These are just some options available, the one that is right for you will depend on your use case.

Netsuite Saved Search formula to extract text string

For a Netsuite account, I have noticed the entityid for a customer (the customer ID on the UI) appears as an alphanumeric value using the organisation's customer number format.
However, in a saved search, it appears in the following format,'ACC12345 Parent entity name: ACC67895 Child entity name'. I am trying to use a formula to get the child entity's customer ID number from this text string.
The following formula mostly works in a saved search to extract the child entity's customer ID number (i.e. the 'ACC67895 ' in the above example
SUBSTR({entityid},INSTR({entityid},'ACC',1,2),8)
Is there a way to replace the 8 in this formula with another formula so that it extracts everything from the second 'ACC' onwards until the first blank ' '?
The number of characters of the customer ID varies so I don't want to use 8 as a hard coded value in the formula.
Thanks
I would suggest having your first SUBSTR return everything from the start of the child customer's ID to the end, then nest that inside a second SUBSTR which would use an INSTR to find the space after the ID and cut off everything after that:
SUBSTR(SUBSTR({entityid},INSTR({entityid},'ACC',1,2)),1,INSTR(SUBSTR({entityid},INSTR({entityid},'ACC',1,2)),' '))
Ugly, but it works.

How to create a chart in stack driver which will show the counts of API label from logs

I am very new to stack driver and trying to implement some charts which i have implemented in splunk for a different product.
We have the api name in the logs under textPaylod field and i want to extract the api name from the field and create a chart based on the counts of API names.
ex below is the sample log.
type: "k8s_container"
}
severity: "INFO"
textPayload: "19-04-29T04:30:51.058+0000 INFO PostFilter: POST response to http://<endpoint>/abc/def/users/getNames
"
timestamp: "2019-04-29T04:30:51.059143860Z"
}
type: "k8s_container"
}
severity: "INFO"
textPayload: "19-04-29T04:30:51.058+0000 INFO PostFilter: POST response to http://<endpoint>/abc/def/users/getPhoneNumbers
"
timestamp: "2019-04-29T04:30:51.059143860Z"
}
I've create a custom metric and extracted the text after "/abc/def" into API_NAME label expecting to use it as group function in the metric.
Crating Custom Metric
When i tried to explore the metric and see the counts in a stacked bar i am not able to find the counts by apiname
Metric Explorer
When asking for help debugging a specific issue you've encountered following existing instructions, you may get a better response by emailing google-stackdriver-discussion#googlegroups.com .
As outlined in Logs-based Metric Labels, you should specify the appropriate capture group to extract the value of the label.
You can then see the time series for the logs-based metric you've created (see https://cloud.google.com/monitoring/api/troubleshooting for how to query the raw data). It's likely that your regular expression is not matching exactly what you think it's matching, and you are always getting an empty value for the API_Name label. One suspect is the escaped \? in your pattern — according to the RE2 syntax, ? should not be escaped.

XML for Analysis (XML/A) format of member names?

I have two different XML/A providers, Mondrian and icCube. The tuples for a time dimension contain the unique name for the member, but the format of the member name is different:
Mondrian:
<UName>[Time].[2004].[QTR2].[Apr]</UName>
<Caption>Apr</Caption>
[Time] is the name of the hierarchy
[2004] is the name of the ancestor at the Year level
[QTR2] is the name of the ancestor at the Quarter level
[Apr] is the local name of the member at the Month level
icCube:
<UName>[Time].[Calendar].[Month].&[Jun 2010]</UName>
<Caption>Jun 2010</Caption>
[Time] is the name of the dimension
[Calendar] is the the name of the
hierarchy
[Month] is the name of the level
[Jun 2010] is the name of
the month member.
(I don't know why the ampersands are there)
My question is, is there any recommended, preferably standard way to figure out how the member names are formatted?
The reason I want to know this is when I render the result in a Pivot table, the captions for the members will usually end up as labels on the headers of the pivot table. But since the captions may not be unique, it is desirable to also produce labels of the "ancestor" members, because together they do identify the member uniquely.
In my example, I could use the parts of the member unique name to do this, but in ic cube not,since the member u name is structured differently.
I have 2 questions:
1) How can I tell beforehand what format the XML/A provider will use to identify the members?
2) What would be the recommended way in ic cube to produce the labels for the ancestor members?
UPDATE:
Luc Boudreau informed me that the ampersand indicates "key notation" - it designates the member key rather than its name. Thanks Luc!
The meaning of unique names in MDX is a string that guarantees that it defines a unique MDX entity when parsed. There is no possible collision with another MDX entity. The way to write it depends on the XMLA provider. Even though it's 'unique' there are multiple ways creating it, each server chooses its way.
Never mind, a query written in one server will work in another as both 'unique' names are correctly parsed.
& amp; stands for &
Our advise, the client code should not rely on the format of the unique names.
That being said, if you need parent "names", you should retrieve them explicitly using the "Parent" function and/or as a calculated measure retrieving the name/caption property.
Hope that helps.

Resources