json-schema-keywords / gen_dataset.sh
michaelmior's picture
Add scripts to reproduce generation
d180a03 verified
raw
history blame contribute delete
439 Bytes
#!/bin/bash
SCHEMA_PATH=$1
function gen_data {
local split=$1
pipenv run python -c "print(__import__('datasets').load_dataset('dataunitylab/json-schema-store')['$split'].to_pandas().to_json(orient='records'))" | \
jq -c '.[]' | \
pipenv run python3 extract_keywords.py | \
pipenv run python augment_neg.py -s "$SCHEMA_PATH" | \
gzip -c > "$split.jsonl.gz"
}
gen_data "train"
gen_data "validation"