Are there any built-in keys I can use in my segmentation rules in Intuit's Wasabi? - ab-testing

I am trying to use user segmentation rules in Wasabi. Are there any built-in keys that I can use?

You can segment on these three things:
The passed segmentation profile
The HTTP Header values
The context parameter
For example, if you wanted to segment on the context, you would build a segmentation rule context = QA, for getting users of chrome a (naive) approach would be to use a segmentation rule that matches the regular expression ".*chrome.*". So for example User-Agent =~ ".*curl.*" & context = "QA" would match users who are in the context QA (?context=QA) and use curl.
Note that sadly the alphabetical operators (e.g. contains) which you can select in the UI are currently broken, we are working on a fix for the (still precompiled) library Hyrule which leverages those rules. For now I recommend converting your rules to the text view or test them to see if they work or not. There is also a validation in place when you try to save a rule.

Related

Using Regex to identify Entity on a Google Action Intent

I have this Intent on Google Actions with a couple of utterances:
and I'm using one of the default system types:
The Bank Account should always be 8 digits so I was thinking if I could use Regex on Google Actions to identify this exact entity when typed by the user.
If yes, how exactly?
Can I just create an utterance with Regex like this: \d{8}
Should I "highlight" as Parameter just like I did with the two given examples as well?
Thanks,
While this is not visible in the Actions Console, it is something that can be done if you download the project to a local environment using gactions.
You can create a new Type in under custom/types. You will use create RegularExpression Entities.
regularExpression:
entities:
# `bankNumber` is your parameter name. It can be custom.
bankNumber:
regularExpressions:
- \d{8} # In the `re2` syntax
Then you'll need to re-upload your project to the Actions Console with gactions push and gactions deploy preview.

IBM Chatbot Assistant - Array with same values

I have this piece of code in JSON editor of Watson:
"context": {
"array": "<? entities['spare_part'].![literal] ?>",
"array_size": "<?$array.size() ?>"
When the input of the user, for example, is "Hello, I need a valve, and the part number of the valve is 1234", the size of the array ends up being 2 since the user mentions the word "valve" twice in his input. Some nodes are being executed depending on size of the array. For instance if the size of the array is 1, some nodes will be ignored because they are only executed only if the size of the array is 2.
I want the array to store only the inputs with different values, which is basically I don`t want the array to store the values of the same type, in my case 2 valves. If it is possible somehow please show me a way.
All that can be done, but the best approach depends on the overall system architecture. Remember that Watson Assistant is a conversation service, not a data processing platform...
You can process JSON in either Watson Assistant directly using the built-in methods and SpEL, see these links to get started:
- https://console.bluemix.net/docs/services/conversation/expression-language.html#expressions-for-accessing-objects
- http://docs.spring.io/spring/docs/current/spring-framework-reference/html/expressions.html
- https://console.bluemix.net/docs/services/conversation/dialog-methods.html#expression-language-methods
That would require some coding within the dialog nodes. It could be ok. What I would recommend is to either process in your app that drives the dialog (you need that app anyway) or to code up small server actions to transform data.
If it is the word you are looking for, you can use contextual entities to train for this.
As an example I created the following intent (along with general intents from catalog).
For each example I highlighted the "valve" word that is the one I am interested in, and added to the entity.
Now when I test it I get the following.
All this was done in a couple of minutes. For production level you may want to add more examples, or think about how you want to annotate.

Apache Wicket event on Page "page was mouted on ..."

I have mount Page in this form (with one predefined parameter):
mountPage("/lista/${variant}", StronaEntityV2.class);
when parameter "variant" is given all is OK. But when parameter is absent (is OK too from application point of view) URL is build in form
wicket/bookmarkable/all....package...StronaEntityV2?8
It is ok too, but I will know that situation. In simple situation (with one predefined parameter) checking parameter is good, but in more complicated isn't so simple (and must maintain code in distinct places).
My ideal imaged solution is event
page.OnPageIsMountedOn(URL to_me)
I will accept wide range of solutions.
FORMAL: please integrate synonyms on tags wicket-1.6 & wicket-6, and create new wicket-7
Your page is configured to listen to /lista/${variant}.
When you do: setResponsePage(StronaEntityV2.class, paramsWithVariant) then Wicket will use the mount point and produce: /lista/variantValue.
But if you do: setResponsePage(StronaEntityV2.class), i.e. no PageParameters provided, then Wicket will ignore /lista/${variant} (because it doesn't match) and will produce a "default" page url, i.e. /wicket/bookmarkable/com.example.StronaEntityV2.
So the application controls which url should be used.
You can use optional parameter placeholder: /lista/#{variant}. Note that I use # instead of $ now. This way Wicket will produce /lista/ when there is no variant parameter provided. In the page constructor you will know that the url is always "/lista" but the parameter may be null, so better use: pageParameters.get("variant").toXyz(defaultValue) or .toOptionalXyz().

Overlapping annotations in GATE

I am trying to merge two annotations in a document and that works fine but I want to select only the annotations which are common to both of them e.g. one annotation highlights a sentence "I am testing my grammar" and the second annotation highlights "testing my grammar". The second annotation also highlights "testing my grammar" at some other place but I dont want to pick that since its not highlighted by the first annotation.
I would like to figure out a way of picking up just the common part. I am using GATE 7.1 and have used normal PRs along with one Annotation Merging PR. Is there some way by which I can create a feature which somehow shows that both annotations have been used?
Thanks
You can use a jape transducer with operator "within", described here.
Here's a simple rule which will match only Ann2 (testing my ..) when it's within another annotation Ann1 (I am testing my ...)
Phase: phrase
Input: Ann1 Ann2
Options: control = appelt
Rule: ann2WithinAnn1
(
({Ann2 within Ann1})
):aa
--> :aa.Overlap = {}
Keep in mind that partial overlaps are harder to catch with jape (or at least I don't know how) for instance:
Ann1 on "I am testing".
Ann2 on "testing my grammar".

Zend Lucene with symfony and i18n

I've went through the Jobeet Tutorial for integrating Zend Lucene into a symfony (1.4.8) project in order to add search capabilities into my frontend of my site (through indexing). Among others, the key concept is to use updateLuceneIndex during model's save action (needs to be overridden) in order to create/update the index of the specific entry.
My model has i18n fields, some of which (i,e name, title) I want to be inserted in the index. Everything works as expected but when it comes to save the i18n fields into the index all I get is blank values ($this->getName() returns empty string). I'm inspecting the created index with the Luke.
I ended up that this has nothing to do with the Zend Lucene but with symfony. It seems that during save the information for i18n fields isn't available (or is it?). I've also tried hook up the update during preSave(), postSave() but no avail.
So I want to ask how am I supposed to get my model's i18n field values during the save action in order to update the index accordingly?
Important note: This happens only during doctrine:data-load task. If I manually insert or update a record the index gets updated accordingly.
One last related question. It would be nice if I could save different keywords for each of the languages of the field of the model. How can I get the different values for each field's language inside the model?
The reason of this strange behaviour of Symfony is that when you are loading fixtures via cli, it has no context loaded (for instance when you try to get context instance sfContext::getInstance(), youll get "context instance does not exists" error exception).
With no context instance available, there is no "current culture" and with no current culture, there is no value of i18n fields.
The symfony context actualy supports all I18N functionalities with current User culture ($currentUserCulture = sfContext::getInstance()->getUser->getCulture()).
This all means 2 things:
You cant use symfony "current user culture" capabilities while you are
in cli session
If you needs to have sfContext::getInstance() somewhere in your
code (especialy in the models), you have to close it into condition to avoid any troubles with unexpected and hard to find exceptions while in cli
Example of getting current culture in model class (it will not pass condition while in cli):
if (sfContext::hasInstance()) {
sfContext::getInstance()->getUser()->getCulture();
}
So when you cant use Symfony i18n shortcuts (like $record->getName()), you have to work around it.
In Your symfony1-doctrine models you always have $this->Translation object available.
So you can access your translation values object via something like $this->Translation[$culture].
Its up to you to work with that, you can use your default culture $this->Translation[sfConfig::get('sf_default_culture')], or interate trough all your supported cultures from some global configuration (i recommends you to set it in one of your configuration files globaly accross of all apps - maybe /config/app.yml).
Example of getting $record Translation object in any situations:
if (sfContext::hasInstance()) {
$translation = $this->Translation[sfContext::getInstance()->getUser()->getCulture()];
}
else {
$translation = $this->Translation->getFirst();
// or: $translation = $this->Translation[$yourPreferedCulture];
}
// you can access to modified fields of translation object
$translationModified = $translation->getModified();