Download utils/io_/instance.py from sanganaka/SanDP: direct link, hf CLI and curl.
- Browser
- Download file 565 Bytes
-
https://huggingface.co/sanganaka/SanDP/resolve/main/utils/io_/instance.py
- Command line
-
hf download hf://sanganaka/SanDP/utils/io_/instance.py
-
curl -L -o instance.py https://huggingface.co/sanganaka/SanDP/resolve/main/utils/io_/instance.py
565 Bytes
| class Sentence(object): | |
| def __init__(self, words, word_ids, char_seqs, char_id_seqs): | |
| self.words = words | |
| self.word_ids = word_ids | |
| self.char_seqs = char_seqs | |
| self.char_id_seqs = char_id_seqs | |
| def length(self): | |
| return len(self.words) | |
| class NER_DependencyInstance(object): | |
| def __init__(self, sentence, tokens_dict, ids_dict, heads): | |
| self.sentence = sentence | |
| self.tokens = tokens_dict | |
| self.ids = ids_dict | |
| self.heads = heads | |
| def length(self): | |
| return self.sentence.length() |