Git Product home page Git Product logo

Comments (4)

LudvigOlsen avatar LudvigOlsen commented on June 18, 2024

We should handle empty strings as it seems like something that could easily happen in an automated system. Either by a) removing them, or b) first excluding them and then adding them back to the result as np.nan for all metrics, or c) raising an error.

a) is the easiest but if the end user expect the same number of rows as they inputted, it's problematic.

b) is probably the best as you would maintain the number of rows in the output with the order matching the input. But this increases complexity of the code as you first have to exclude the empty strings, remember their index and then insert them in the output. Technically you just have to store the indices I guess, although insertion of multiple empty rows might be tricky?

c) would require the user to decide between a) and b) (and then implement it). Seems annoying.

I would probably go with b

Further, perhaps we should have a look at whether to add a check for the length of span in the calculation or just allow it to fail with zero-division?

from textdescriptives.

HLasse avatar HLasse commented on June 18, 2024

Completely agree that b is the way to go. We actually already have handling for this in all components except quality and information_theory. If a metric can't be calculated (e.g. because of empty string) we return np.nan.

@KennethEnevoldsen you know the code for those components the best - is this something you'd be able to take a look at?

from textdescriptives.

LudvigOlsen avatar LudvigOlsen commented on June 18, 2024

And add a unit test when you're at it @KennethEnevoldsen ;)

from textdescriptives.

KennethEnevoldsen avatar KennethEnevoldsen commented on June 18, 2024

🫡

from textdescriptives.

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.