attilanagy234 / neural-punctuator Goto Github PK
View Code? Open in Web Editor NEWComplimentary code for our paper Automatic punctuation restoration with BERT models
License: MIT License
Complimentary code for our paper Automatic punctuation restoration with BERT models
License: MIT License
In line 16 of src/neural_punctuator/models/BertPunctuator.py
add return_dict=False
to from_pretrained()
, otherwise a dict
is returned, from which your code takes the name of the layer, rather than the tensor.
(This will fix the bug with a traceback of dropout expecting a tensor rather than a string)
Execuse me, when I train the model in GPU,I meet this error.Could you help me ?
Traceback (most recent call last):
File "main.py", line 6, in
pipe.train()
File "/workspace/neural-punctuator-main/src/neural_punctuator/wrappers/BertPunctuatorWrapper.py", line 17, in train
self._trainer.train()
File "/workspace/neural-punctuator-main/src/neural_punctuator/trainers/BertPunctuatorTrainer.py", line 106, in train
mask = ((targets == 0) & (np.random.rand(*targets.shape) < .1)) | (targets > 0)
TypeError: and() received an invalid combination of arguments - got (numpy.ndarray), but expected one of:
How did you decide id2target for converting back from prediction to original.
id2target = {-1: 0,
9: 1, # .
60: 2, # ?
15: 3, # ,
-2: -1, # will be masked
}
I have class 1 as , 2 as ? 3 as . and 4 as ! 0 for all others.
How should I use this?
Hi, I wanted to know if you have implemented to check the model output at test time. Because we had aligned labels according to tokens so model output would be according to that. How can we convert them back to original which was before aligning ?
Best Regards
Can you please share the pre-trained model?
What can we do to convert it into tflite or use the pt file on the mobile device?
Hello, can you share the data set of the experiment, the displayed network link can no longer be downloaded.Thanks!
Hello,
I'm kind of new with BERT etc, sorry in advance for the question, but how and where in the code sould I add my own texts, in order to have in the output my texts with the punctuation ?
Thanks,
Camille
Hi, I am getting validation accuracy greater than training and validation loss lesser than train. Can you tell why? Maybe due to class imbalance? I am using different dataset
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.