How to use lookup tables as .tx in Rasa? - rasa-nlu

In my nlu.yml file I have my code as:
- lookup: project
project.txt
My project.txt file in in under data and so is my nlu.yml file.
I'm getting the exception as yaml syntax exception, could not find expectated ':'
Could someone help me out? Where should I put that colon?

You should convert project.txt to yml format.
This answer should help you.

Related

JMeter - Append Timestamp to the File name

I am writing some data into a file. Please find below the snippet in JSR223 Post processor.
import org.apache.commons.io.FileUtils
f = new File("C:/Users/503289283/Downloads/Service_Start.csv")
Filename needs to be appended with the Timestamp. Tried using ${__time(dd-MM-yyyy_HH:mm:ss,)} and Date.getTime(). It doesn't work. Not sure if am doing it right.
Kindly help.
Regards,
Ajith
I tried with
new File('C:/Users/503289283/Downloads/Service_Start_ ' + new Date().format('dd-MM-yyyy_HH:mm:ss') + '.csv')
It throws an error.
Log:
javax.script.ScriptException: java.io.FileNotFoundException: C:\Users\503289283\Downloads\Service_Start_ 14-03-2022_10:13:12.csv (The filename, directory name, or volume label syntax is incorrect)
whereas
new File("C:/Users/503289283/Downloads/Service_Start.csv")
works perfectly.
Is something missed here? Please help.
How about:
new File('C:/Users/503289283/Downloads/Service_Start_ ' + new Date().format('dd-MM-yyyy_HH:mm:ss') + '.csv')
More information:
Groovy JDK Enhancements - Date
Apache Groovy - Why and How You Should Use It

Struggling with file upload path on cURL

Beginner user on cURL. I'm really struggling with the path format used to upload a file through cURL.
curl -X POST https://XXXXXXXXX … -F file=#C:\Users\John\Downloads\test.csv
I keep getting the following error message "curl: (26) Failed to open/read local data from file/application"
Most of the examples provided start with file=#/home/, which is confusing as I don't have such directory to my understanding. Also, examples use "/" instead of "\". Why is it so?
Can anyone provide some feedback on how to properly write the path to a file?
Thanks!
Finally solved this! After some trials and errors, I figured out that the path's syntax should have used double backslash, so:
C:\\Users\\John\\Downloads\\test.csv
and not:
C:\Users\John\Downloads\test.csv
Honestly, I have never used this syntax before and don't understand why this is required. Your comments/input would certainly be appreciated.

How do I pass an array of configurations to a YAML file in Golang?

I am trying to create a YAML configuration file using gosexy/yaml.
I know how to create a YAML file of the following format:
another:
tree:
- 1
I use the code settings.Set("another","tree",[]int{1}) to create the above file.
Now, how can I create a file of the format
another:
- tree: 1
I tried using the code settings.Set("another",[]{yaml.Set("tree",1)}) to create the above file. As it might be obvious, I receive a type error since I am not passing the type to the array.
Am I on the right track? If yes, what should be the type to be passed. If no, what is the alternative way to do this?
the type of tree that you need is []map[string]int
example code:
settings := yaml.New()
settings.Set("another", []map[string]int{{"tree": 1}})
settings.Write("test.yaml")
the result of test.yaml
another:
- tree: 1
hope it help

Converting from .dat to netcdf(.nc)

I have a .dat file https://www.dropbox.com/s/8dbjg0i6l7a4sb6/CRUST10-xyz-complete.dat?dl=0 that I need to convert to either .grd or .nc, so that I can visualize the data in GMT(Generic Mapping Tool). I tried to do this using cdo using following command:
cdo -f nc import_binary CRUST10-xyz-complete.dat CRUST10-xyz-complete.nc
but got following error:
Open Error: Unknown keyword in description file
--> The invalid description file record is:
--> 0.5,89.5,4.19,0,2,0.7,0,0.73,1.62,5.01,14.25,10.06,7.36,2.7,1.5,3.81,2,3.5,0,5,6.5,7.1,8.07,5.5865805168986,6.7596467391304,2.3888888888889
The data file was not opened.
cdo import_binary (Abort): Open failed!
Can anyone please guide?
First make .ctl file then apply:-
cdo -f nc import_binary CRUST10-xyz-complete.ctl CRUST10-xyz-complete.nc
Here is the example link for to make .ctl file. http://cola.gmu.edu/grads/gadoc/descriptorfile.html
It will definitely work for you. Thanks!
Without the data itself, it is hard to see what went wrong. In any case, just look at the following message from cdo forum:
https://code.mpimet.mpg.de/boards/1/topics/3631
which you could use as an example of how to convert ASCII data to netCDF using cdo's.

search and replace part of string in file

I have a file that looks like this.
/n01/mysqlarch1/mysql-bin.000011
/n01/mysqlarch1/mysql-bin.000012
/n01/mysqlarch1/mysql-bin.000013
/n01/mysqlarch2/mysql-bin.000014
/n01/mysqlarch2/mysql-bin.000015
/n01/mysqlarch2/mysql-bin.000016
I want to be able to search for both mysqlarch1 and mysqlarch2 and replace with mysqldata1.
Therefore the file would end up looking like...
/n01/mysqldata1/mysql-bin.000011
/n01/mysqldata1/mysql-bin.000012
/n01/mysqldata1/mysql-bin.000013
/n01/mysqldata1/mysql-bin.000014
/n01/mysqldata1/mysql-bin.000015
/n01/mysqldata1/mysql-bin.000016
any help would be greatly appreciated.
sed can do the job:
sed 's/mysqlarch[12]/mysqldata1/g' file
/n01/mysqldata1/mysql-bin.000011
/n01/mysqldata1/mysql-bin.000012
/n01/mysqldata1/mysql-bin.000013
/n01/mysqldata1/mysql-bin.000014
/n01/mysqldata1/mysql-bin.000015
/n01/mysqldata1/mysql-bin.000016

Resources