provide Custom Entities to Google NLP engine - google-cloud-nl

I want the Google NLP engine to be able to recognize custom entities.
I have a company called Hint and I want it to tag it as an organization.
'I like hint'
or
'I like Hint'
does not tag Hint as a organization. It tags Hint as "Other" entity type.
Is there some key word to provide to Google NLP so I can talk to it. For example can I pre process my text such as
I like %CUSTOM_ENTITY%

We don't currently have a mechanism for adding custom entities.
I'd be interested to learn more about what you'd like to do. How many entities would you like to put in? What kinds of information would you like to include? Are you thinking of a list of entity names and types?

Related

Indexing dynamic fields in azure search

I have used solr search engine which has a feature of dynamic fields. For example , if we define product_* field in the schema.xml, it will accept all the fields starting with product_ during the indexing.
Is there a feature like this in azure search where we can just define a wildcard for a field and it can accept the related fields in the indexing? As the fixed field thing reduces flexibility and one has to define a new schema every time for adding new fields.
Azure Cognitive Search does not support dynamic fields. Adding fields to the schema as you detect them during indexing is the suggested workaround.
Please consider creating an item on our User Voice page for this. While we haven't considered adding support for dynamic fields specifically, we have been looking at making schemas more flexible and extensible, and your input could help us prioritize this.

How do I create a Dialogflow custom entity that works like #sys.airport?

Since #sys.airport only exists for the default English locale, I want to create a custom entity that emulates it for other locales.
From what I've read here, you can put subentity types into the value fields, say, the system entity #sys.geo-city:city and a custom entity #usr.iata-code:iata, and it will match either one or the other.
But I don't understand how you would tell Dialogflow which city and which IATA code go together, so that Dialogflow (ES) would know to send the complete object {"city":"Amsterdam", "iata": "AMS"} to the webhook after matching either "Amsterdam" or "AMS", as it does happen with #sys.airport.
Thanks for any input!
It will be difficult to create a custom entity that works just like #sys.airport. The #sys entities are special and can do somethings custom entities can't, for instance, pairing values together.
As you pointed out, you can put multiple entities together in one single entity by using Composite Entities, but the only thing this does is allow you to recognize two values made up from other #sys or custom entities in a single entity. It doesn't give you the option to create pairs between the values of the entities.
If you would want to create something like this, you would need some code that does a look up in a dictionary or list. So when "AMS" is matched, the code fills in the missing property "Amsterdam" or vice versa.

Dialogflow Agent regex entities definition

I have created an agent in dialogflow, for which I want to define an entity based on regex values, I know we have regex capability in defining the entities, but I don't know how to use it or how to define regex while defining the entity. There are no examples or blogs available to help me with this. I want to see an example or syntax of how to define regex entities so that I can replicate the same for my case. Any help will be highly appreciated.
Try this. Go to the Entity page. Create a new Entity an call it whatever you want. In the entity screen select regex and enter this value [A-Za-z]{3}[0-9]{7,10}$. Save the Entity. This regex will validate any value that begins with three letters and 7 to 10 character. Example PAP1234567 or DWL123456789.
Now go to an, intent or create one, and on the training phrases add one that says:
My number is PAP12345678. Select the PAP12345678 to highlighted and the entities menu will appeared. Select the new regex entity and save.
Test the intent on DialogFlow. Hope this help.

Zend Translate Poedit and the Translation Context

is there a way to use the "context" or "msgctxt" in Zend_Translate when I call the method $translator->translate('My String') ?
I need to classify the item to be translated to a specific context for instance:
Customer Administration
Shopping Cart
Order Administration
I need to use the contexts to solve ambiguities between the translation items.
At the moment I am using the PoEdit software and Zend_Translate to translate my project.
Thanks
I was searching this too, and it would seem that Zend_Translate does not support translation context.
You could try to extend the main Zend_Translate class and implement the translation context as some kind of prefix that is automatically used together with the sentence or terms to be translated, for example:
$translate->translate($context, $sentence);
would be internally managed as
parent::translate("$context|$sentence");
and
$translate->translate($context, array($singular, $plural, $num));
would be
parent::translate(array("$context|$singular", "$context|$plural", $num));
but this would require to have the string with the prefixed $context in your translation sources.

Extending Orchard Search and Indexing

We need to provide search options for users to find content based on specific field values.
We're developing a Training Course module for a client but the standard search looks for the text in any indexed field. We want to allow users to find courses based on searches against specific fields (i.e. Course Type, Location, Price, Date).
We've extended the search to check against specific fields but can't work out how to get the URL parameters passed by the Search form as a GET.
Where does Orchard put URL parameters?
Also, are we missing something, is there a way that Orchard already supports this that we haven't realized?
I would suggest you to copy part of the Search module, more specifically the Controller and the View and then modify it to suit your specific needs. I see you are actually modifying the original module, but this might be a problem on the long term, for instance if we start updating the module you might either lose you changes or have to reapply them to the code base. In the end you will target a MySiteName.Search module. And you can also add custom routes, custom settings.
On a side note the Search API is really powerful and you can even use it to do faceted search, or search on inherited taxonomy terms, tags, full text, ranges, ... Having your own controller code will let you use all of these features easily.

Resources