This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import spacy | |
from spacy import displacy | |
doc2 = { | |
"text": "But Google is starting from behind.", | |
"ents": [{"start": 4, "end": 10, "label": "ORG"}], | |
"title": None | |
} | |
displacy.render(doc2, style="ent", manual=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TypingPredictor: | |
def __init__(self, typing_model, vocab, args): | |
self.gpu = args.gpu | |
self.model = typing_model | |
self.cuda_device = args.cuda_device | |
self.sequence_iterator = BasicIterator(batch_size=args.batch_size) | |
self.sequence_iterator.index_with(vocab) | |
def tonp(self,tsr): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import spacy # version 2.1.4 | |
import scispacy | |
nlp = spacy.load('en_core_sci_md') | |
def prevent_sentence_boundaries(doc): | |
for i, token in enumerate(doc): | |
if not can_be_sentence_start(token, doc): | |
token.is_sent_start = False | |
return doc |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dataset umls | |
dropout 0.5 | |
train 1 | |
bag_size 10 | |
encoder position_cnn | |
struct_weight 0.5 | |
typing_weight 0 | |
multilabel_linking 0 | |
parent_sample_size 100 | |
bilinear_l2 0.0005 |