Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

holdout.py 357 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
  1. # This code generates holdout data for the submission server
  2. import os, json
  3. ret = {}
  4. for fname in os.listdir("test_lbl"):
  5. if not fname.endswith('.txt'):
  6. continue
  7. with open("test_lbl/" + fname, 'r') as f:
  8. ret[fname.replace(".txt", "")] = [l.strip() for l in f.readlines()]
  9. with open('holdout.data', 'w') as f:
  10. json.dump(ret, f)
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...