fix: print out stderr

This commit is contained in:
monoid 2022-02-22 17:45:53 +09:00
parent a7e447b6d6
commit 54e757c247

View File

@ -1,5 +1,6 @@
import sys
from read_data import TagIdConverter, make_long_namedEntity, readKoreanDataAll, Sentence
from typing import Any, NamedTuple, List, Sequence, TypeVar
import json
@ -45,16 +46,16 @@ if __name__ == "__main__":
PRETAINED_MODEL_NAME = 'bert-base-multilingual-cased'
rawTrain, rawDev, rawTest = readKoreanDataAll()
print("load tokenzier...")
print("load tokenzier...",file=sys.stderr)
tokenizer = BertTokenizer.from_pretrained(PRETAINED_MODEL_NAME)
converter = TagIdConverter()
print("process train...")
print("process train...",file=sys.stderr)
train = preprocessing(tokenizer,converter,rawTrain)
saveObject(path.join(PRE_BASE_PATH,"train.json"),train)
print("process dev...")
print("process dev...",file=sys.stderr)
dev = preprocessing(tokenizer,converter,rawDev)
saveObject(path.join(PRE_BASE_PATH,"dev.json"),dev)
print("process test...")
print("process test...",file=sys.stderr)
test = preprocessing(tokenizer,converter,rawTest)
saveObject(path.join(PRE_BASE_PATH,"test.json"),test)