Closed zerogerc closed 3 years ago
Am I right that currently I can only retrain model with feat=tag?
Yeah, there're only models without pos embeddings available right now. You have to retrain it if you do need a model with exactly the same settings as biaffine parser.
And to use pos when predicting, the only way is to parse from a .conllx file. Passing pos into predict
is not supported yet.
As to using a combination of char and pos, I refer you to my sdp impl.
Thanks for the quick reply!. I found this code in CoNLL(Transform)
, so I think passing pos tags to predict is supported?
def load():
...
if isinstance(data, str):
with open(data, 'r') as f:
lines = [line.strip() for line in f]
else:
data = [data] if isinstance(data[0], str) else data
lines = '\n'.join([self.toconll(i) for i in data]).split('\n')
...
def toconll(cls, tokens):
if isinstance(tokens[0], str):
s = '\n'.join([f"{i}\t{word}\t" + '\t'.join(['_']*8)
for i, word in enumerate(tokens, 1)])
else:
s = '\n'.join([f"{i}\t{word}\t_\t{tag}\t" + '\t'.join(['_']*6)
for i, (word, tag) in enumerate(tokens, 1)])
return s + '\n'
And could you explain what do you mean by sdp impl
?
@zerogerc
Thanks for the quick reply!. I found this code in CoNLL(Transform), so I think passing pos tags to predict is supported?
Yeah, you're right. Sorry for missing this.
And could you explain what do you mean by sdp impl?
I mean if you do need the combination of features, you can refer to my impl of semantic dependency parsing. Or if you're not in a hurry, please wait for my next release.
Thanks a lot!
I've used the same approach as in sdp
and retrained the model with combined features. Now it works.
Hi, thanks for the great library.
I wonder if there are any models which use pos tags as additional inputs for predictions? I've tried
biaffine-dep-en
with no result:I expected dependency trees to be different for this cases (first case: root = flies, second: root = like).
Am I right that currently I can only retrain model with
feat=tag
? If is would it be possible to somehow use a combination ofchar-lstm
andpos
features?