OpenNLP - Named Entity Recognition - dd.mm.yyyy Date format in txt file for .bin model training - opennlp

My txt file for model training has date tags in dd.mm.yyyy format. But when I try to use the trained .bin file, the dates are not extracted as they should. My txt tagged file is written one sentence in line. I was wondering maybe the format, and the fullstops in this date format make a difficulty for the model to learn. In the official OpenNLP documentation I can see there is a bin file with date extraction, but I can't see the txt file containing the tags.
I tried to open this bin as a txt format but I read in Stack Overflow that I can't do that.
How can I view the content of a .bin file in opennlp

Related

Month Format in Unix

I am trying to create a shell script for auditing purpose. In my source data the value of month contains like yyyym(20217) format. I need to extract the records based on this month type.
is there any dateformat to print like this in Unix?

Postgresql with Laravel: Filter Json field with substring

I am having a table say post_media which has a JSON column metadata. Now, metadata JSON has a field says originalName which has the full name of file/media eg: test.png.
All kind of files are there like: .png, .jpeg, .mov, .pdf, .ppt, .doc and etc
I want to select find only png files from the table. There is no separate column for the extension.
I've tried it with virtual columns using as and mutator. But where is not working with virtual columns.
$post_media = PostMedia::select(\DB::raw("metadata->>'originalName' from '\.([^\.]*)$') as file_extention"))->where('file_extention', 'png')->get();
I want all PNG extension files. Any idea?
What you can do is just put your regex condition on where condition like below.
$post_media = PostMedia::select(\DB::raw("metadata->>'originalName' from '\.([^\.]*)$') as file_extention"))->whereRaw("metadata->>'originalName' from '\.([^\.]*)$')='png'")->get();
It will help you.

Convert Oracle Standard Report output from text to excel

I have a user requirement to convert oracle standard report (Transaction Historical Summary)'s output into Excel
I have tried to change output to xml to get the xml tags so to make rdf but it ends in error.
What are the steps to convert a standard report's output to excel?
You'd use Report Builder's DESFORMAT=SPREADSHEET parameter; it works for Reports 10gR2 onwards.
Here's a tutorial which shows how to do that: "Building a Report for Spreadsheet Output" (https://docs.oracle.com/cd/B14099_19/bi.1012/b13895/orbr_paptoexcel.htm).
It doesn't make sense to copy/paste all those steps over here, so - have a look, follow the instructions.
If you're on lower version, you'd create a CSV (comma-separated-values) file (choose any delimiter you want, such as comma or semi-colon). Although it is not a XSL(X) file, Excel is capable of opening it nicely.

Insert image into a csv column ruby

I'm currently doing a crawler for a website, and my goal is to have a CSV, with a name in the first column and an image the second one, which is inserted with a Ruby script using the CSV#open method.
I have already used this method but I don't know, and I don't find information about the problematic that is to insert an image into a column.
Is it really possible? If not, which functionality would you use to have a list with string + image after crawling?
A CSV (Comma Separated Values) file is a TEXT file which as the name implies has various values separated by commas, expressed using plain ASCII, or sometimes unicode. It is intended as a light weight way to transfer tabular data between different computer systems or programs. You can use it to spit out a table in a database, or the VALUES in something like a spreadsheet. The normal convention is for the first row(line) of the file to contain names or labels that represent what that column contains, and then data in the subsequent rows.
As such, there really is no practical way to embed an image within a CSV file. This is not a limitation of Ruby or Watir, but a limitation of textfiles which spans pretty much all languages and operating systems.
To do what you want you would be better off to save the images into a specific directory using unique filenames and insert those filenames into the CSV file.

How do I export a spreadsheet (csv) in excel using ascii control characters as the delimiters?

I have this csv file that I would like to parse with Ruby. The file's data is a cluster with commas and new lines in the fields but Excel still reads it properly. If the file could be exported from excel using the unit and record separators as the delimiters for the columns and rows, I'd be golden.
Anybody know how to specify those characters in excel? Thanks!
Use Ruby CSV with this option:
:col_sep
The String placed between each field. This String will be transcoded
into the data’s Encoding before parsing.
See more here: http://ruby-doc.org/stdlib-2.0.0/libdoc/csv/rdoc/CSV.html
I ended up having Google Sheets export the file as json. Steps I followed here There were 10,000 records and the browser tab crashed when it tried to do all of them. So I had to piece meal it. I'm sure there's a better way to do it.

Resources