Datasets:

Modalities:
Text
Languages:
English
Libraries:
Datasets
License:
asahi417 commited on
Commit
4a5609e
1 Parent(s): 989839e

fix readme

Browse files
Files changed (36) hide show
  1. create_split.py +9 -9
  2. data/t_rex.filter_unified.min_entity_1_max_predicate_10.train.jsonl +2 -2
  3. data/t_rex.filter_unified.min_entity_1_max_predicate_10.validation.jsonl +2 -2
  4. data/t_rex.filter_unified.min_entity_1_max_predicate_100.train.jsonl +2 -2
  5. data/t_rex.filter_unified.min_entity_1_max_predicate_100.validation.jsonl +2 -2
  6. data/t_rex.filter_unified.min_entity_1_max_predicate_25.train.jsonl +2 -2
  7. data/t_rex.filter_unified.min_entity_1_max_predicate_25.validation.jsonl +2 -2
  8. data/t_rex.filter_unified.min_entity_1_max_predicate_50.train.jsonl +2 -2
  9. data/t_rex.filter_unified.min_entity_1_max_predicate_50.validation.jsonl +2 -2
  10. data/t_rex.filter_unified.min_entity_2_max_predicate_10.train.jsonl +2 -2
  11. data/t_rex.filter_unified.min_entity_2_max_predicate_10.validation.jsonl +2 -2
  12. data/t_rex.filter_unified.min_entity_2_max_predicate_100.train.jsonl +2 -2
  13. data/t_rex.filter_unified.min_entity_2_max_predicate_100.validation.jsonl +2 -2
  14. data/t_rex.filter_unified.min_entity_2_max_predicate_25.train.jsonl +2 -2
  15. data/t_rex.filter_unified.min_entity_2_max_predicate_25.validation.jsonl +2 -2
  16. data/t_rex.filter_unified.min_entity_2_max_predicate_50.train.jsonl +2 -2
  17. data/t_rex.filter_unified.min_entity_2_max_predicate_50.validation.jsonl +2 -2
  18. data/t_rex.filter_unified.min_entity_3_max_predicate_10.train.jsonl +2 -2
  19. data/t_rex.filter_unified.min_entity_3_max_predicate_10.validation.jsonl +2 -2
  20. data/t_rex.filter_unified.min_entity_3_max_predicate_100.train.jsonl +2 -2
  21. data/t_rex.filter_unified.min_entity_3_max_predicate_100.validation.jsonl +2 -2
  22. data/t_rex.filter_unified.min_entity_3_max_predicate_25.train.jsonl +2 -2
  23. data/t_rex.filter_unified.min_entity_3_max_predicate_25.validation.jsonl +2 -2
  24. data/t_rex.filter_unified.min_entity_3_max_predicate_50.train.jsonl +2 -2
  25. data/t_rex.filter_unified.min_entity_3_max_predicate_50.validation.jsonl +2 -2
  26. data/t_rex.filter_unified.min_entity_4_max_predicate_10.train.jsonl +2 -2
  27. data/t_rex.filter_unified.min_entity_4_max_predicate_10.validation.jsonl +2 -2
  28. data/t_rex.filter_unified.min_entity_4_max_predicate_100.train.jsonl +2 -2
  29. data/t_rex.filter_unified.min_entity_4_max_predicate_100.validation.jsonl +2 -2
  30. data/t_rex.filter_unified.min_entity_4_max_predicate_25.train.jsonl +2 -2
  31. data/t_rex.filter_unified.min_entity_4_max_predicate_25.validation.jsonl +2 -2
  32. data/t_rex.filter_unified.min_entity_4_max_predicate_50.train.jsonl +2 -2
  33. data/t_rex.filter_unified.min_entity_4_max_predicate_50.validation.jsonl +2 -2
  34. data/t_rex.filter_unified.test.jsonl +2 -2
  35. filtering_purify.py +0 -1
  36. t_rex.py +4 -4
create_split.py CHANGED
@@ -37,19 +37,26 @@ if not os.path.exists("data/t_rex.filter_unified.test.jsonl"):
37
  print(f"{json.dumps(i, indent=4)}")
38
  flag = input(">>> (enter to add to test)")
39
  if flag == '':
 
 
 
40
  f_writer.write(json.dumps(i) + '\n')
41
  f_writer.close()
42
 
43
  with open("data/t_rex.filter_unified.test.jsonl") as f:
44
  data_test = [json.loads(i) for i in f.read().split('\n') if len(i) > 0]
45
- test_predicate = set([i['predicate'] for i in data_test])
46
 
47
 
48
  seed(42)
49
  for min_e_freq, max_p_freq in product(parameters_min_e_freq, parameters_max_p_freq):
50
  with open(f"data/t_rex.filter_unified.min_entity_{min_e_freq}_max_predicate_{max_p_freq}.jsonl") as f:
51
  data = [json.loads(i) for i in f.read().split('\n') if len(i) > 0]
52
- data = [i for i in data if i['predicate'] not in test_predicate]
 
 
 
 
53
  shuffle(data)
54
  data_train = data[:int(len(data) * 0.9)]
55
  data_valid = data[int(len(data) * 0.9):]
@@ -57,10 +64,3 @@ for min_e_freq, max_p_freq in product(parameters_min_e_freq, parameters_max_p_fr
57
  f.write('\n'.join([json.dumps(i) for i in data_train]))
58
  with open(f"data/t_rex.filter_unified.min_entity_{min_e_freq}_max_predicate_{max_p_freq}.validation.jsonl", "w") as f:
59
  f.write('\n'.join([json.dumps(i) for i in data_valid]))
60
-
61
-
62
- #
63
- # # make test split
64
- # with open(f"data/t_rex.filter_unified.jsonl") as f:
65
- # data = [json.loads(i) for i in f.read().split('\n') if len(i) > 0]
66
- # train_data, validation_data, test_data = create_split(data)
 
37
  print(f"{json.dumps(i, indent=4)}")
38
  flag = input(">>> (enter to add to test)")
39
  if flag == '':
40
+ i['relation'] = i.pop('predicate')
41
+ i['head'] = i.pop('subject')
42
+ i['tail'] = i.pop('object')
43
  f_writer.write(json.dumps(i) + '\n')
44
  f_writer.close()
45
 
46
  with open("data/t_rex.filter_unified.test.jsonl") as f:
47
  data_test = [json.loads(i) for i in f.read().split('\n') if len(i) > 0]
48
+ test_predicate = set([i['relation'] for i in data_test])
49
 
50
 
51
  seed(42)
52
  for min_e_freq, max_p_freq in product(parameters_min_e_freq, parameters_max_p_freq):
53
  with open(f"data/t_rex.filter_unified.min_entity_{min_e_freq}_max_predicate_{max_p_freq}.jsonl") as f:
54
  data = [json.loads(i) for i in f.read().split('\n') if len(i) > 0]
55
+ for i in data:
56
+ i['relation'] = i.pop('predicate')
57
+ i['head'] = i.pop('subject')
58
+ i['tail'] = i.pop('object')
59
+ data = [i for i in data if i['relation'] not in test_predicate]
60
  shuffle(data)
61
  data_train = data[:int(len(data) * 0.9)]
62
  data_valid = data[int(len(data) * 0.9):]
 
64
  f.write('\n'.join([json.dumps(i) for i in data_train]))
65
  with open(f"data/t_rex.filter_unified.min_entity_{min_e_freq}_max_predicate_{max_p_freq}.validation.jsonl", "w") as f:
66
  f.write('\n'.join([json.dumps(i) for i in data_valid]))
 
 
 
 
 
 
 
data/t_rex.filter_unified.min_entity_1_max_predicate_10.train.jsonl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:bc8f09b851bc4e5a559d91b2b6eab602fcd7a01d9b8b1cb5da6d25a6f955c227
3
- size 1572501
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a8cdbf3a283b002925fec1afdc7dd361371fa7fcb74e8cf30992d5e8d260de59
3
+ size 1565697
data/t_rex.filter_unified.min_entity_1_max_predicate_10.validation.jsonl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:2cfecf612971bc6346ee1cbf60598237d746588b49f3bf2a2d47a758043e6e8b
3
- size 167641
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:66005b0dcfc95d73531b68f83b1d99d0a23c8896dc1e9a0134dfe6d18000320b
3
+ size 166879
data/t_rex.filter_unified.min_entity_1_max_predicate_100.train.jsonl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:25e3e2bfe7ae82ae789a1ca7acbdfdf1f4f8ddecce38b2841d7eb1d59ef3b25a
3
- size 9485883
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b3c554b56bae1e5c5fc857ecff4cb0c5084c5f359b83339933fbbd6a1dfb4964
3
+ size 9443433
data/t_rex.filter_unified.min_entity_1_max_predicate_100.validation.jsonl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:3cbe1dcf6a1cabccafd4741c758d77692ad036178c58cb216c9d9900ef618600
3
- size 973661
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ee5a21bab254e93893686be4295317ab3baa306f4f5201f62d909285f719dd9c
3
+ size 968939
data/t_rex.filter_unified.min_entity_1_max_predicate_25.train.jsonl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:9c131f6d16f3ac410d5a8eec498dc170fac19cb4eedb3a3b6f55ab8036d2044e
3
- size 3261339
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d9042463fe69bc8be135a9bae519fac5937f43e3701e7130e0cde76badaed82c
3
+ size 3247191
data/t_rex.filter_unified.min_entity_1_max_predicate_25.validation.jsonl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:c390b61d8aba59d46860dc08c951fa41a03aa703aeced1853093875b0c256683
3
- size 359678
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:63db817d18ff85b07df3a2762939dcece12fd2010a8857add034362342706bab
3
+ size 358106
data/t_rex.filter_unified.min_entity_1_max_predicate_50.train.jsonl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:fb18c0b4372a1f2896edea758c3664e2136305eda0beb0db46b9b0f5a5ba9a96
3
- size 5662197
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f13171463ef6e69eea94cc300d38f54b492a85f470c1c72c73b6e40c2cf83f5e
3
+ size 5637411
data/t_rex.filter_unified.min_entity_1_max_predicate_50.validation.jsonl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:13388320c2c516979d3921345402b3582ffd450fb5e207fef0564a5b94cfb0a0
3
- size 633329
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:afd61d9ed3f524a6226e49db437df518165f9a7dde18e3b873cf4c1d62c3ebef
3
+ size 630575
data/t_rex.filter_unified.min_entity_2_max_predicate_10.train.jsonl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:0e50f0b2edde1889ff118c8e71a7f8926a2b645191585d51439feb29332177f2
3
- size 1176841
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:df4eb48be825c5db70006eb41f47570c68a29acb4dc04aaf7a155cea119de729
3
+ size 1171693
data/t_rex.filter_unified.min_entity_2_max_predicate_10.validation.jsonl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:d0850ef15867726d82a9bcd137b955dda570c6000d017232767df35cd10fabd0
3
- size 161287
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:86e09036006125140f912f05c4529bafd6c2331562003ed2f7c9fd1b0e159afa
3
+ size 160711
data/t_rex.filter_unified.min_entity_2_max_predicate_100.train.jsonl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:ac27e100b2a01ff62b5589c331792f3c99fb6d6b60e301e77a054e9e0a40c106
3
- size 6624170
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8483f5be57b80552ecb4710cbf53abcfe45ea91e463284f575b8c8d5d5f2b4d8
3
+ size 6594932
data/t_rex.filter_unified.min_entity_2_max_predicate_100.validation.jsonl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:ccb437dde9614d3f3910c4bedef64b22c220cc351d76e357936d6e00326c8cf5
3
- size 764614
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:24d6efe638a4ba043612f2ba52dc81501d22d20a55b877e60cd124a73eac77e9
3
+ size 761362
data/t_rex.filter_unified.min_entity_2_max_predicate_25.train.jsonl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:f28002af18a25c1138508d83cd19c09d2c26415daa4411863f6e5df45a51a096
3
- size 2449432
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6ef6f8cc1bbce41ee85eef2fd186cb96aa9658eec8687d9843797936f6ee0d9b
3
+ size 2439166
data/t_rex.filter_unified.min_entity_2_max_predicate_25.validation.jsonl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:41cfa5f0b99a91a97e746bb39aaa52675362bb1cfeccddea22f8580b8ca9efef
3
- size 262350
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:993405320d0811ffbda37456a21856c5257852bd88d1041e9f22034059237954
3
+ size 261204
data/t_rex.filter_unified.min_entity_2_max_predicate_50.train.jsonl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:685370c8e9c78b0c727fbebe3fd4383bb8dbae4a7db57d35c1adccbcc0370531
3
- size 4229631
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:34bc9f4463c4bd1f085d4219b58a4314ba8b330822517b355c1bb4b2d651f2a2
3
+ size 4211619
data/t_rex.filter_unified.min_entity_2_max_predicate_50.validation.jsonl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:a957289a37dc78fd5723a2387b5456788b8bb753d759e516365cab14ea2a9ed7
3
- size 456150
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8878b991b0d700ff0da61abd4368001fbed3d0d91d87cdc49128052813e004d0
3
+ size 454146
data/t_rex.filter_unified.min_entity_3_max_predicate_10.train.jsonl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:558c35eb779e32adc9e61e9c65f217023cbb6345797ea6e38cc77a1242869609
3
- size 987080
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1d349e003f740bfd092142bda3a18b53a50fc2e42d776ab927b671fd683d6b3d
3
+ size 982946
data/t_rex.filter_unified.min_entity_3_max_predicate_10.validation.jsonl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:031229448bbff483379de066ad8091416eb671f6c459ba2fed5ee3b26c1d8260
3
- size 129219
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:62841e632a18ccb85dd287fdb971b29dde73c0b4a5df98fd70f50567c89b5f2b
3
+ size 128757
data/t_rex.filter_unified.min_entity_3_max_predicate_100.train.jsonl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:7741374496f112e89adcb33cc630846f4bfad15351225d08eb7ac05dbc88283f
3
- size 5050139
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fc7dc0801745bfece68deba3c72eb1a377c168d9127e14af9045e5998df078eb
3
+ size 5028185
data/t_rex.filter_unified.min_entity_3_max_predicate_100.validation.jsonl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:e54d47b72f313c7907f5ad2d312d49ac1b3fcdfb6e36affc51f72545400a8acd
3
- size 555656
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4e692671afd4d3e991f0ebefe3cd59df2b3851bcbe021ad3df5a3a06856b7420
3
+ size 553214
data/t_rex.filter_unified.min_entity_3_max_predicate_25.train.jsonl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:ed13076ba7a2d6fb1e09a26d2fc4cf7f33d7de2e2981af0f6098d166c5246f82
3
- size 2009775
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a1f44e3e50ba4a2a75af5b1144de4170decef738c52ea649a6db57108c545c53
3
+ size 2001435
data/t_rex.filter_unified.min_entity_3_max_predicate_25.validation.jsonl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:db26496c97d21dea24339242edfeb0ecd375dfd709d678255bd8c15e00b0c5ac
3
- size 211869
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9f54c63116a78e4712451be2e7452a25ede659311f397f5e925501e790ad98ad
3
+ size 210939
data/t_rex.filter_unified.min_entity_3_max_predicate_50.train.jsonl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:52607bfdd909e393fd8e88a313ef615212c6397fa3ca947d647711fffa7121d5
3
- size 3325216
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:893673af83b9bc5fd73669d2000884936ccf55e2184405d518d552aeba7b3b85
3
+ size 3311200
data/t_rex.filter_unified.min_entity_3_max_predicate_50.validation.jsonl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:5183448c90edd8f3f9afba56bb33876e25d5687d54397b04b0a4134550455c81
3
- size 352189
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3f08bd81057414dbd5b399a43eaa1805853be53e6edabc058b7842ebd4323851
3
+ size 350629
data/t_rex.filter_unified.min_entity_4_max_predicate_10.train.jsonl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:176541d9dac930c9dc37db7f34ff46f14002d2503b98e8eebd12fb0b0f944c3a
3
- size 872851
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:335cd6b2be2e1abbf677efebb5e4dda545d8cd79a04a25433ac13ab77fd78b29
3
+ size 869233
data/t_rex.filter_unified.min_entity_4_max_predicate_10.validation.jsonl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:eed71082fc2d1258c666eefd8de416b8bb71a8e1fc07b73be0aa3fb3d7b87c44
3
- size 100668
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2298db64d6f839621db2cbcc200e77cd1b9178c7e25ba46a86aa2a0e63a3816b
3
+ size 100260
data/t_rex.filter_unified.min_entity_4_max_predicate_100.train.jsonl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:35df4cef3040bea8f13554b052f5fee91e877f86d3a468e0c59dd49e186a7fa4
3
- size 4212771
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:282ec575b1f35f5ea11b76a3d7e98d6257f3419fa396dc19c71b3f6879890cf5
3
+ size 4194801
data/t_rex.filter_unified.min_entity_4_max_predicate_100.validation.jsonl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:a85b7633999b6e0c99c1966cfb837bbf4f5bf02f190b9703fd9baf30a9a9c7e3
3
- size 464065
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c46d0beeac6bc592c3e8058ace196d3d254db0fda3c103963e324d8eb5e44ecd
3
+ size 462067
data/t_rex.filter_unified.min_entity_4_max_predicate_25.train.jsonl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:57bfbd0bc77b13dcb61e5252d9027b8501e90a71f010400f215bfa24ecb98f52
3
- size 1765040
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f1d0e2edc50dff9f8a34eb70a311f128a461ff0aaf5d2afea8be85767c55b010
3
+ size 1757714
data/t_rex.filter_unified.min_entity_4_max_predicate_25.validation.jsonl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:b3372679101afe1ded5ff51df410970022e1e4a24a8903958e272c903fc65cd3
3
- size 207714
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8f9e4e4369959100b1266c60c0865c20078bc5550e76ad31f20ad8fede048ea8
3
+ size 206898
data/t_rex.filter_unified.min_entity_4_max_predicate_50.train.jsonl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:70a2a687cea7841257c5aaf21c65210142111432c79cab6f15b2ffd988a51332
3
- size 2828221
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d7ea19e24ae2bef133da5e7118d04b91e047c528643c0fc4469a3937646b5ce6
3
+ size 2816287
data/t_rex.filter_unified.min_entity_4_max_predicate_50.validation.jsonl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:8bbc12e9ae9352b3b958b8b5a92c812c74d433a753d13ba4d42331eca5cffc9c
3
- size 313659
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9d895b67231ad903e0e94770c4a07c711c0152e5745b30a0f814b589c3b300cb
3
+ size 312327
data/t_rex.filter_unified.test.jsonl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:ff8b5493874e807299d0319a5e21415acae27f856366b9d4694548d70bbeb64f
3
- size 173460
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:21c903c02acc553fa21bd2fcdbec73cf8dd170f4ad9a3fd3dbb910e3991b9dbe
3
+ size 172728
filtering_purify.py CHANGED
@@ -71,7 +71,6 @@ def main(min_entity_freq, max_pairs_predicate, min_pairs_predicate: int = 3, ran
71
  df_balanced.pop("count_object")
72
  df_balanced.pop("count_sum")
73
  df_balanced = df_balanced.drop_duplicates(subset=['subject', 'object', 'predicate'], keep='last')
74
-
75
  # return data
76
  target_data = [i.to_dict() for _, i in df_balanced.iterrows()]
77
  predicate_dist = df_balanced.groupby("predicate")['text'].count().sort_values(ascending=False).to_dict()
 
71
  df_balanced.pop("count_object")
72
  df_balanced.pop("count_sum")
73
  df_balanced = df_balanced.drop_duplicates(subset=['subject', 'object', 'predicate'], keep='last')
 
74
  # return data
75
  target_data = [i.to_dict() for _, i in df_balanced.iterrows()]
76
  predicate_dist = df_balanced.groupby("predicate")['text'].count().sort_values(ascending=False).to_dict()
t_rex.py CHANGED
@@ -7,7 +7,7 @@ import datasets
7
  logger = datasets.logging.get_logger(__name__)
8
  _DESCRIPTION = """T-Rex dataset."""
9
  _NAME = "t_rex"
10
- _VERSION = "0.0.7"
11
  _CITATION = """
12
  @inproceedings{elsahar2018t,
13
  title={T-rex: A large scale alignment of natural language with knowledge base triples},
@@ -77,11 +77,11 @@ class TREX(datasets.GeneratorBasedBuilder):
77
  description=_DESCRIPTION,
78
  features=datasets.Features(
79
  {
 
 
 
80
  "title": datasets.Value("string"),
81
  "text": datasets.Value("string"),
82
- "predicate": datasets.Value("string"),
83
- "object": datasets.Value("string"),
84
- "subject": datasets.Value("string")
85
  }
86
  ),
87
  supervised_keys=None,
 
7
  logger = datasets.logging.get_logger(__name__)
8
  _DESCRIPTION = """T-Rex dataset."""
9
  _NAME = "t_rex"
10
+ _VERSION = "0.1.0"
11
  _CITATION = """
12
  @inproceedings{elsahar2018t,
13
  title={T-rex: A large scale alignment of natural language with knowledge base triples},
 
77
  description=_DESCRIPTION,
78
  features=datasets.Features(
79
  {
80
+ "relation": datasets.Value("string"),
81
+ "head": datasets.Value("string"),
82
+ "tail": datasets.Value("string"),
83
  "title": datasets.Value("string"),
84
  "text": datasets.Value("string"),
 
 
 
85
  }
86
  ),
87
  supervised_keys=None,