How to create template file for biagrams in crf++ - crf++

I have train file in following format.
word(column0), its corresponding biagram(column 1-21) and word(column 22).
For example
दुव्र्यवहार दु ुव व् ्र र् ्य यव वह हा ार - - - - - - - - - - व्यवहार
I have to create a template such that on the basis of biagram, model can predict the word(word at last column)

Basically, you a need 22 feature templates ( for column 0 - 21 ) in your template file and it should work.
You can a look at youtu.be/GJHeTvDkIaE to get a better understanding about template file.

Related

Excel Nested IF statements with ISBLANK, AND, and NOT ISBLANK

Here's the formula I've entered:
=IF(AND(ISBLANK(F2),(NOT(ISBLANK(G2)))),CONCATENATE(B2," - ",G2," pcs/box")),
IF(AND(ISBLANK(G2),(NOT(ISBLANK(F2)))),CONCATENATE(B2," - ",F2," sf/box")),
IF(AND(NOT(ISBLANK(F2), (NOT(ISBLANK(G2)))),CONCATENATE(B2," - ",F2," sf/box - ",G2," pcs/box")),"")
This is to format a spreadsheet to concatenate fields and text depending on whether fields do or do not have data. I've included "" at the end for the final else. Excel is telling me that I've entered too many arguments for this function. One that is simpler (where I only have one if, then an else) is working. But there are times when I need to check for additional empty fields. (Or cells) So, the first IF would give the tile name(B2) - #(G2) pcs/box. The second IF would give the tile name(B2) - #(F2) sf/box. The third IF would give the tile name(B2) - #(F#) sf/box - #G2) pcs/box. The final "" would give a blank. I hope you can help. I've looked everywhere. I'm stumped. I've looked at the () to make sure they're matched.
Your brackets are a little off. Try this one.
=IF(AND(ISBLANK(F2),(NOT(ISBLANK(G2)))),CONCATENATE(B2," - ",G2," pcs/box"),IF(AND(ISBLANK(G2),(NOT(ISBLANK(F2)))),CONCATENATE(B2," - ",F2," sf/box"),IF(AND(NOT(ISBLANK(F2)),(NOT(ISBLANK(G2)))),CONCATENATE(B2," - ",F2," sf/box - ",G2," pcs/box"),"")))
A little simpler:
=IF(OR(F2<>"",G2<>""),B2&IF(F2<>""," - "&F2&" sf/box","")&IF(G2<>""," - "&G2&" pcs/box",""),"")

Kusto Query Language: set column name of summarize by evaluated expression

Me again asking another Kusto related question (I really wish there would be a thorough video tutorial on this somewhere).
I have a summarize statement, that produces two columns for y axis and one for x axis.
Now i want to relabel the columns for x axis to show a string, that i also got from the database and already put into a variable with let.
This basically looks like this:
let android_col = strcat("Android: ", toscalar(customEvents
| where application_Version contains secondLatestVersionAndroid));
let iOS_col = strcat("iOS: ", toscalar(customEvents
| where application_Version contains secondLatestVersionIOS));
... some Kusto magic ...
| summarize
Android = 100 - (round((countif(hasUnhandledErrorAndroid == 1 ) * 100.0 ) / countif(isAndroid == 1), 2)),
iOS = 100 - (round((countif(hasUnhandledErroriOS == 1) * 100.0 ) / countif(isIOS == 1), 2))
by Time
|render timechart with (ytitle="crashfree users in %", xtitle="date", legend=visible )
Now i want to have the summarize display not Android and iOS, but the value of android_col and iOS_col.
Is that possible?
Best regards
Maverick
Generally, it's suggested to have predefined column names, otherwise various features don't work. For example, IntelliSense won't know the names of the columns, as they would be determined at run time only. Also, if you create a function that returns a dynamic schema, you won't be able to run this function from other clusters.
However, if you do want to change column names, you definitely have a way to do it by using various plugins. For example, bag_unpack, pivot and others.
As for courses on Kusto, there are actually several excellent courses on Pluralsight (all are free):
How to start with Microsoft Azure Data Explorer
Basic KQL
Azure Data Explorer – Advanced KQL
The usage of the "toscalar" in this query looks wrong, it seems to me that you should use the "extend" operator with the same logic to create the additional columns.

MIGX Event Calendar

I have created a custom Eventcalendar with the following structure:
- Event 1 (Modx-Ressource 1)
Date/Time 1 (Migx-TV-Record) (i.e. 01-02-2016)
Date/Time 2 (Migx-TV-Record) (i.e. 01-03-2016)
...
- Event 2 (Modx-Ressource 2)
Date/Time 1 (Migx-TV-Record) (i.e. 01-04-2016)
Date/Time 2 (Migx-TV-Record) (i.e. 01-01-2016)
...
That means that the Modx-Ressource has some Information about the Event (like Ticketprice, Description, Title...) and multiple Eventdates/-times stored in a Migx-TV.
That worked so far... But i try to make a Output which i can sort by date, limit and so on... Maybe the output looks like this:
Event 2, Date/Time 2 (i.e. 01-01-2016)
Event 1, Date/Time 1 (i.e. 01-02-2016)
Event 1, Date/Time 2 (i.e. 01-03-2016)
Event 2, Date/Time 1 (i.e. 01-04-2016)
How can i get this done? Sorry for my bad English.
Using the MIGX getImageList snippet you can sort and filter:
[[!getImageList?
&tvname=`YourEventsTV`
&tpl=`YourEventTpl`
&sort=`[{"sortby":"your_event_start_date","sortdir":"asc"}]`
&where=`{"your_event_limit:>=":"100"}`
]]
Add a sort clause or a where clause (uses JSON strings for both). The MODX manual has some more information on all the options available.

Update and Replace multiple fields but receivng error after each statement

I am updating multiple fields and my query works each statement correctly but errors when it goes to the next row. I comment out the preceeding row and rerun and runs the statement and errors on the next line.
I.e
UPDATE mydb
SET VendorMPD = replace(VendorMPD,'VENDOR Campaign MPD - ','');
SET VendorMPDHalf = replace(VendorMPDHalf,'Vendor MPD 1/2 Count - ','');
SET DieselMPD = replace(DieselMPD,'Diesel Pumps - ','')
Error that it generates each time:
[Err] 42000 - [SQL Server]Incorrect syntax near '='.
I had this working perfectly yesterday but needed to add additional fields and when I did this is what started happening. I looked at the new statements that I entered and with exception to the field names and what they are replacing. The coding is identical.
Try the following syntax to update multiple columns in a single statement:
UPDATE mydb
SET VendorMPD = replace(VendorMPD,'VENDOR Campaign MPD - ',''),
VendorMPDHalf = replace(VendorMPDHalf,'Vendor MPD 1/2 Count - ',''),
DieselMPD = replace(DieselMPD,'Diesel Pumps - ','');

Movable Type: Create index page with MTTags

I want to make a index page (like you see one in beginning of dictionaries) with MTTags from a blog using MT5.1. There might be some jQuery solutions but I would love to accomplish this with Movable type tags. Here is what I have so far.
<ul>
<mt:Tags sort_by="Name">
<li><mt:TagName></li>
</mt:Tags>
</ul>
I would like the result be like below:
A
- Apple
- apricot
B
- bee
C
- Cake
- Cinnamon
D
- Dog
- Dragon
First we need to isolate the first character:
<$mt:TagName regex_replace="/(?<=.).*$/","" $>
(that is a zero-width positive look-behind assertion) but we want it as capital letter, and to save it to a variable:
<$mt:TagName regex_replace="/(?<=.).*$/","" upper_case="1" setvar="current_index" $>
Now we only need to compare it to the last index, to see if we need to output the index header:
<mt:Tags sort_by="Name">
<$mt:TagName regex_replace="/(?<=.).*$/","" upper_case="1" setvar="current_index" $>
<mt:unless name="last_index">
# this is the first time
<mt:else name="current_index" ne="last_index">
# need to output the new index
</mt:unless>
<mt:var name="current_index" setvar="last_index">
<li><mt:TagName></li>
</mt:Tags>
<mt:if name="last_index">
# close the list
</mt:if>
The html tags are left to the reader. :-)

Resources