Giter Club home page Giter Club logo

Comments (4)

markus-eberts avatar markus-eberts commented on July 28, 2024

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.

jmlongriver avatar jmlongriver commented on July 28, 2024

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.

markus-eberts avatar markus-eberts commented on July 28, 2024

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.

jmlongriver avatar jmlongriver commented on July 28, 2024

Thanks for your suggestions, I already figured it out, there are empty tokens.

from spert.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.