文件历史

12 次代码提交

作者 SHA1 备注 提交日期
Ulyana 980c6ddc07 Extend package support Python 10-14 + relax dependencies (#1276) 2026-01-07 14:11:40 -08:00
Jonas Mueller 0167accd0a license (#1263)
change license to Apache 2.0

---------

Co-authored-by: Anish Athalye <me@anishathalye.com>
2025-12-15 16:56:30 -08:00
Elías Snorrason 2d00c91f40 Update numpy.typing import and annotations (#688)
* refactor: ♻️ move numpy.typing under TYPE_CHECKING and add future annotations
2023-05-01 16:58:48 +00:00
unna97 503a57adaf Adding type hints for mypy strict compatibility (#585)
* Handling missing type & docs in cleanlab/token_classification_utils.py 🏷️
    - Added typehints for the cleanlabs/token_classification_utils.py file for mypy strict mode
    - Fixed corresponding docstrings refers #587

* Handling missing type & docs in cleanlab/multilabel_classification.py 🏷️
 - Fixing all errors for mypy strict for the file

* docs(internal): fix "number of new classes" variable in docstring

Co-authored-by: Elías Snorrason <eliassno@gmail.com>
2023-01-10 13:46:16 +00:00
Aditya Thyagarajan 7b589f6d63 updating copyright year to include 2023 (#594) 2023-01-06 21:25:57 -08:00
Elías Snorrason 8ff371c16c separate word coloring from token-replacement (#514)
Fixes #513
2022-10-31 14:21:05 +00:00
Elías Snorrason fd50f6b9c6 Deploy docs for token classification module (#438)
* docs: 📝 add usage example for get_sentence

Also remove types in docstrings.

* docs: 📝 add usage examples for filter_sentence

* docs: 📝 add page for internal.token_classification_utils

* docs: 📝 remove name of return variable

auto-tagging won't work correctly for the return value if it's not a tuple

* 📝 add pages for modules in cleanlab.token_classification

* fix indentation

* 📝 add token classification api to toctree

* 🎨 format docstrings

* 📝 add usage examples

* update example comment

* 📝 add usage examples

* 📝 add return variable name in docstring

* 📝 remove some hard-coded params types in rank module

Keep more complex parameters hard-coded for now. E.g. "enum"-like parameters.

* 🎨 remove indentation of parameters in docstrings

* 🎨 fix indentation

* colored docstring typo + formatting

* typo: occurence

* probs_merged docstring typo + formatting

Co-authored-by: Jonas Mueller <1390638+jwmueller@users.noreply.github.com>
2022-09-14 14:59:26 -07:00
Jonas Mueller 23067aa9c6 Headers for newly added modules (#409)
* header for multiannotator module

* header for outlier module

* header for token_classification.filter

* header for token_classification.rank

* header for token_classification.summary

* header for util

* header for latent_algebra

* header for label_quality_utils

* header for token_classification_utils

* header for huggingfacekerasclassifier

* add experimental modules' dependencies to readme
2022-09-08 09:20:26 -07:00
Elías Snorrason 8371edffc9 🐛 escape special regex characters (#404)
Fixes #403
2022-09-06 09:28:59 -07:00
Elías Snorrason 71521e90d3 Match token/s in color_sentence (#397)
*  search tokenized sentence for coloring

Searches through the list of tokens before trying to match substrings. Thanks for this code suggestion Eric!

* 🚧 fix signature in all calls to color_sentence

*  update color_sentence test after changing its api

(sentence, word) -> (word, tokens)

*  use regex for coloring tokens in sentence

Find word boundaries with regex, use builtin replace() as fallback w/o boundaries.

Closes #288

* 🚑 invert fallback condition

Use replace if NO substitutions were made with regex.
2022-09-05 16:30:29 -07:00
Elías Snorrason 6ec5b173dd Cleanup token classification utils (#390)
* 🏷️ restrict parameters for list types

* 🐛 only process characters in input token

Example: process_token("Cleanlab", [("C", "a"), ("a", "C")]) should return "aleCnlCb", not "CleCnlCb".

*  use all sentences in test_get_sentence

*  add test cases to test_filter_sentence

*  extent test cases in test_mapping

* 📝 clean up docstrings

Restrict arg types based on docstrings. Fix punctuation and typos. Add examples to docstring.

*  split tests for filter_sentence

*  extend test_merge_probs

*  test merge_probs with ignored/normalized columns in probs

*  extend test cases for get_sentences

* ⚰️ remove unused pandas import

* 🏷️ pass strict mypy check

We ignore np.max as it is untyped.

No issues found in token_classification_utils.py by running
```
mypy --install-types --non-interactive --strict cleanlab/internal/token_classification_utils.py
```

* 👷 add strict type-checking in CI

* 💚 use strict type-check for single file

*  remove strict type check in CI

* refactor: 🏷️ use np.ndarray type instead of npt.NDArray

*  go back to generic np.ndarray type

* ♻️ always return tuple in filter_sentence

Remove unused argument+docstring. Simplify relevant unit tests.

* 🔥 resolve comments on typing

Remove ignore-comments. Remove duplicate tag in docstring. Remove unused imports.

* 🔥 remove duplicate tag in docstring
2022-09-01 17:07:39 -07:00
Eric Wang 1bad2f82a2 Adding functionality for cleanlab to find label errors in token classification datasets (#347)
* add token_classification functionality

* add typing

* fix typing

* add typing

* fixed typing and black

* fix typing
2022-08-30 09:17:07 -07:00