This is a functional utility to retrieve product short codes along with their names and calculated similarity score from l2 scores for a given question.
results are stored both in
JSONandCSV
-
clone the repo
git clone https://github.com/homingos/short-code-mapper
-
install dependencies
npm install
-
add all <questions,answer> pairs in
questions.txt. -
Set the environment(Env) as either
devorprodIn line 40; milvus_dao_impl.go -
Set the environment variables. Refer
go-server/.env.localfolder -
run the go server
cd go-server && go run main.go
- Hit the below API endpoint first, in order to create a
shortcodetonamemapping. You need a validsitecodehttp://localhost:3000/generate-mappings/<sitecode>
this would create a
mapping_<sitecode>.json
-
Next, run the client script for automated data creation
node client
-
check
short_code_output.csvandshort_code_output.jsonfor results.
Caution! The above two files will be appended for repeated runs. Duplicates are not handled. Erase content for any new run as needed.