Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # coding: utf-8
- import numpy as np
- import sys
- def domain_id(train_file, valid_file):
- train_set = np.load(train_file, encoding='latin1').tolist()
- valid_set = np.load(valid_file, encoding='latin1').tolist()
- domain = {key: value for value, key in enumerate(np.unique([data['domain'] for data in train_set] + [data['domain'] for data in valid_set]))}
- print(domain)
- def main():
- # include here your dirs
- domain_id('./train.npy', './valid.npy')
- if __name__== "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement