I’m making my first attempt to use a Huggingface model and I’m having a few issues I’m hoping someone can help me out with. I need a word sense disambiguation algorithm and jpelhaw’s model seems like the only one on hf. I’m having a few issues getting the code to run.
First, even though the code presented seems to be python, the input value isn’t formatted in a way I understand. It looks like the key-value pairs of a dictionary, but the keys and values aren’t their own strings. Also, the “list” for the descriptions key has an or before the string in the last list item. (see below)
descriptions:[ " A drink consisting of an infusion of ground coffee beans " ,
" a platform-independent programming lanugage "
, or " an island in Indonesia to the south of Borneo " ]
This isn’t a format I’ve ever seen before. Is this the author’s own format for accepting inputs or is it some markup language I haven’t seen before?
Next, when I try to execute the line
answer = model.generate(input_ids=example['input_ids'],
attention_mask=example['attention_mask'],
max_length=135)
it tries to call example like a dictionary, but the previous line of code
example = tokenizer.tokenize(input, add_special_tokens=True)
returns example as a list. Looking through the program I don’t see any objects with the keys ‘input_ids’ or ‘attention_mask’, so i don’t know where those keys are coming from.
I feel like I’m at a dead end. Is there a different way I should be approaching this model or if it possible that this model is not ready for deployment yet. Also, and this is a really basic question, but is there a way I can look at the source code for this model so I can get a better idea what the author is trying to do or is that not a thing huggingface allows? Thanks for your help.
Eric