File size: 459 Bytes
05922fb |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
from sftp import SpanPredictor
predictor = SpanPredictor.from_path(
# '/home/gqin2/public/release/sftp/0.0.1/framenet/model.tar.gz', # For CLSP grid
"../model.mod.tar.gz", # For BRTX
cuda_device=-1 # Change this to 0 for CUDA:0
)
while True:
sentence = input(">>>")
result = predictor.predict_sentence(sentence)
for child in result.span:
print(child)
for sub_child in child:
print("\t", sub_child)
|