Update process.py
Browse files- process.py +4 -5
process.py
CHANGED
@@ -34,11 +34,10 @@ def wget(url, cache_dir: str = './cache'):
|
|
34 |
def read_file(file_name):
|
35 |
with open(file_name) as f_reader:
|
36 |
df = pd.DataFrame([i.split('\t') for i in f_reader.read().split('\n') if len(i) > 0], columns=['relation', 'head', 'tail', 'flag'])
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
return df_positive
|
42 |
|
43 |
|
44 |
if __name__ == '__main__':
|
|
|
34 |
def read_file(file_name):
|
35 |
with open(file_name) as f_reader:
|
36 |
df = pd.DataFrame([i.split('\t') for i in f_reader.read().split('\n') if len(i) > 0], columns=['relation', 'head', 'tail', 'flag'])
|
37 |
+
df = df[df['flag'] != '0']
|
38 |
+
df.pop('flag')
|
39 |
+
df = df[[not i.startswith("Not") for i in df.relation]]
|
40 |
+
return df
|
|
|
41 |
|
42 |
|
43 |
if __name__ == '__main__':
|