1
0
Fork 0
mirror of https://github.com/qurator-spk/sbb_ner.git synced 2025-07-05 17:09:58 +02:00
sbb_ner/qurator/sbb_ner/ground_truth/join_gt.py
2019-08-16 15:22:13 +02:00

29 lines
515 B
Python

import pandas as pd
import click
import os
@click.command()
@click.argument('files', nargs=-1, type=click.Path())
def main(files):
"""
Join multiple pandas DataFrame pickles of NER ground-truth into one big file.
"""
assert(len(files) > 1)
gt = list()
for filename in files[:-1]:
gt.append(pd.read_pickle(filename))
gt = pd.concat(gt, axis=0)
os.makedirs(os.path.dirname(files[-1]), exist_ok=True)
gt.to_pickle(files[-1])
if __name__ == '__main__':
main()