Comments (4)
It looks as if your dev dataset contains samples with empty sentences, i.e. sentences without real tokens. Is this the case? If so, please remove these samples from your dataset.
from spert.
I used the program to check the data to find anything with empty token list, nothing was found.
then I use the following code to monitor if the input is empty, but nothing was found, do you have any sense why?
def _create_eval_sample(doc, max_span_size, context_size):
encoding = doc.encoding
token_count = len(doc.tokens)
if token_count == 0:
print ("EMPTY TOKENS")
for token in doc._tokens:
print (token._phrase)
# create entity candidates
entity_spans = []
entity_masks = []
entity_sizes = []
#print ("max:", max_span_size + 1)
for size in range(1, max_span_size + 1):
#print ((token_count - size) + 1)
for i in range(0, (token_count - size) + 1):
#print ("size:", size)
#print ("i:", i)
span = doc.tokens[i:i + size].span
entity_spans.append(span)
entity_masks.append(create_entity_mask(*span, context_size))
entity_sizes.append(size)
#print ("mask len:", len(entity_masks))
if len(entity_masks) == 0:
print ("ZERO ENTITY MASKS")
for token in doc._tokens:
print (token._phrase)
from spert.
This is a bit hard to investigate without seeing your dataset. However, the exception "RuntimeError: stack expects a non-empty TensorList" should only occur if the entity_masks list is empty. Are you sure that len(entity_masks) is greater than 0 when the exception occurs? Can you please set 'sampling_processes = 0' in your configuration file, rerun the experiment and send me the output of your print statements when the exception occurs?
from spert.
Thanks for your suggestions, I already figured it out, there are empty tokens.
from spert.
Related Issues (20)
- How to easily use this model for inference HOT 3
- Can't make predictions following the example HOT 8
- Help! Help! HOT 1
- Help, HOT 6
- How to call only the relation classifier on a pair of entities? HOT 2
- What is the meaning of the dataset tensors? HOT 1
- Simple example issue HOT 1
- Parts of entities are recognised separately HOT 3
- How does span filtering work? HOT 3
- Runtime Error HOT 1
- RuntimeError: copy_if failed to synchronize: cudaErrorAssert: device-side assert triggered HOT 4
- Does SpERT work with GPT models? HOT 1
- How to prepare dataset for training the model? HOT 9
- Can't download datasets
- TypeError: 'NoneType' object is not callable HOT 1
- Can't make train following the example
- Trained model : Relation classification is bad
- HELP HOT 1
- Extract entities and relation from Spacy tokens?
- [WARNI] NaN or Inf found in input tensor. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spert.