Due to the 512 length limit, you have basically two options:
- You cut the longer texts off and only use the first 512 Tokens. The original BERT implementation (and probably the others as well) truncates longer sequences automatically. For most cases, this option is sufficient.
- You can split your text in multiple subtexts, classify each of them and combine the results back together ( choose the class which was predicted for most of the subtexts for example). This option is obviously more expensive.
You can read about these options here.
is it the same to use patentbert from google and huggingface anferico/bert-for-patents ?
Yes, both versions will work with the given use case. You can look at a simplified comparison between the services here.
neuron compiling a bert modelasked 21 days ago
Not able to convert Hugging Face fine-tuned BERT model into AWS Neuronasked 5 months ago
Unable to compile model to Neuron: no error message, no outputAccepted Answerasked 3 months ago
AWS Pytorch Neuron Compliation Errorasked 2 months ago
Is it possible to compile a neuron model in my local machine?asked 2 months ago
I cant save neuron model after compile the model into an AWS Neuron optimized TorchScriptasked a month ago
neuron compiling bert model for inferentia on tf2asked a month ago
inferentia neuron core usage is only 1 when 4 cores are availableasked 8 days ago
Not able to compile to NEFF, the BERT model from neuron tutorialasked 2 months ago
Issue with loading neuron modelasked 25 days ago