liyuanlucasliu / ld-net Goto Github PK
View Code? Open in Web Editor NEWEfficient Contextualized Representation: Language Model Pruning for Sequence Labeling
Home Page: https://arxiv.org/abs/1804.07827
License: Apache License 2.0
Efficient Contextualized Representation: Language Model Pruning for Sequence Labeling
Home Page: https://arxiv.org/abs/1804.07827
License: Apache License 2.0
Thank you!
@LiyuanLucasLiu
code:
`!pip install lightner
from lightner import decoder_wrapper
model = decoder_wrapper()
model.decode(["Ronaldo", "won", "'t", "score", "more", "than", "30", "goals", "for", "Juve", "."])`
FileNotFoundError Traceback (most recent call last)
Cell In [6], line 5
3 from lightner import decoder_wrapper
4 # model = decoder_wrapper("http://dmserv4.cs.illinois.edu/pner0.th", configs)
----> 5 model = decoder_wrapper()
6 model.decode(["Ronaldo", "won", "'t", "score", "more", "than", "30", "goals", "for", "Juve", "."])
File /usr/local/lib/python3.9/dist-packages/lightner/commands/decoder.py:174, in decoder_wrapper(model_file_path, configs)
171 pw = wrapper(configs.get("log_path", None))
173 logger.info("Loading model from {} (might download from source if not cached).".format(model_file_path))
--> 174 model_file = wrapper.restore_checkpoint(model_file_path)
176 model_type = model_file['config'].get("model_type", 'char-lstm-crf')
177 logger.info('Preparing the pre-trained {} model.'.format(model_type))
File /usr/local/lib/python3.9/dist-packages/torch_scope/wrapper.py:161, in basic_wrapper.restore_checkpoint(file_path)
146 @staticmethod
147 def restore_checkpoint(file_path):
148 """
149 Restore checkpoint.
150
(...)
159 A dict
contains 'model' and 'optimizer' (if saved).
160 """
--> 161 return torch.load(cached_url(file_path), map_location=lambda storage, loc: storage)
File /usr/local/lib/python3.9/dist-packages/torch/serialization.py:699, in load(f, map_location, pickle_module, **pickle_load_args)
696 if 'encoding' not in pickle_load_args.keys():
697 pickle_load_args['encoding'] = 'utf-8'
--> 699 with _open_file_like(f, 'rb') as opened_file:
700 if _is_zipfile(opened_file):
701 # The zipfile reader is going to advance the current file position.
702 # If we want to actually tail call to torch.jit.load, we need to
703 # reset back to the original position.
704 orig_position = opened_file.tell()
File /usr/local/lib/python3.9/dist-packages/torch/serialization.py:230, in _open_file_like(name_or_buffer, mode)
228 def _open_file_like(name_or_buffer, mode):
229 if _is_path(name_or_buffer):
--> 230 return _open_file(name_or_buffer, mode)
231 else:
232 if 'w' in mode:
File /usr/local/lib/python3.9/dist-packages/torch/serialization.py:211, in _open_file.init(self, name, mode)
210 def init(self, name, mode):
--> 211 super(_open_file, self).init(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: '/root/.ts_cache/b91f996d8ec980e293ffd169408e9f99b9728f4024744405bef1f2f04ecaedd5/download.cached'
@LiyuanLucasLiu
Thank you very much!
https://github.com/divelab/dtn
Is the link I want?
@LiyuanLucasLiu
Thank you very much!
Why use detach()
?
Thank you! @LiyuanLucasLiu
Thanks for sharing.
Thank you! @LiyuanLucasLiu
Currently, CoreNLP NER supports from 3 classes CoNLL to the MUC-7 classes, depending on the model loaded in the CoreNLP pipeline:
# tags: LOCATION, ORGANIZATION, PERSON
edu/stanford/nlp/models/ner/english.all.3class.distsim.crf.ser.gz
# tags: DATE, LOCATION, MONEY, ORGANIZATION, PERCENT, PERSON, TIME
edu/stanford/nlp/models/ner/english.muc.7class.distsim.crf.ser.gz
# LOCATION, MISC, ORGANIZATION, PERSON
edu/stanford/nlp/models/ner/english.conll.4class.distsim.crf.ser.gz
They can also be combine all together to obtain the 7 classes output CFR predictor.
It would be possible to support the MUC-7 classes?
Thank you.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.