提交

1096 次代码提交

作者 SHA1 备注 提交日期
Jonas Mueller fff06759b7 skip big dataset coverage
GitHub Markdown Links / test (push) Has been cancelled
CI / Test: Python 3.10 on macos-latest (push) Has been cancelled
CI / Test: Python 3.6 on macos-latest (push) Has been cancelled
CI / Test: Python 3.7 on macos-latest (push) Has been cancelled
CI / Format (push) Has been cancelled
CI / Test: Python 3.8 on macos-latest (push) Has been cancelled
CI / Type check (push) Has been cancelled
CI / Test: Python 3.9 on macos-latest (push) Has been cancelled
CI / Test: Python 3.10 on ubuntu-latest (push) Has been cancelled
CI / Test: Python 3.6 on ubuntu-latest (push) Has been cancelled
CI / Test: Python 3.7 on ubuntu-latest (push) Has been cancelled
CI / Test: Python 3.8 on ubuntu-latest (push) Has been cancelled
CI / Test: Python 3.9 on ubuntu-latest (push) Has been cancelled
CI / Test: Python 3.10 on windows-latest (push) Has been cancelled
CI / Test: Python 3.6 on windows-latest (push) Has been cancelled
CI / Test: Python 3.7 on windows-latest (push) Has been cancelled
CI / Test: Python 3.8 on windows-latest (push) Has been cancelled
CI / Test: Python 3.9 on windows-latest (push) Has been cancelled
CI / Lint Notebooks (push) Has been cancelled
v2.1.0
2022-09-16 22:42:27 -07:00
Curtis G. Northcutt ac59f4f486 Clearer code examples on docs main page (#430)
* Prepare for v2.1.0 release

Co-authored-by: Elías Snorrason <eliassno@gmail.com>
Co-authored-by: Jonas Mueller <1390638+jwmueller@users.noreply.github.com>
2022-09-16 21:52:23 -07:00
Hui Wen dd95a1c2bb Add helper function to reduce code duplication (#463) 2022-09-16 20:38:25 -07:00
Jonas Mueller 460e1fa0c9 update readme +version for v2.1 (#457)
Co-authored-by: Curtis G. Northcutt <curtis.northcutt@gmail.com>
2022-09-16 20:21:36 -07:00
Ulyana 5da046da9e Added support for returning ranked issue idxs (#459)
* Added support for returning ranked issue idxs
- code
- tests
- docstring

Co-authored-by: Jonas Mueller <1390638+jwmueller@users.noreply.github.com>
Co-authored-by: Curtis G. Northcutt <curtis.northcutt@gmail.com>
2022-09-16 20:20:52 -07:00
Anish Athalye f7e01ed382 Fix docs build in CI (#462)
This patch pins the Pandoc version to a more recent release (2.19.2).

As explained in d8cc2e5056, nbconvert
translates Markdown -> reST -> HTML, and it uses Pandoc for this
Markdown -> reST conversion. Older versions of Pandoc don't do a
high-fidelity conversion; in particular, they don't have great support
for mixed Markdown/HTML content.

Consider the following Markdown, the core of how we use the details
disclosure element in several tutorial notebooks:

    <details><summary>Summary</summary>

    Body.

    </details>

Using Pandoc 2.19.2, this converts to the following reST:

    .. raw:: html

       <details>

    .. raw:: html

       <summary>

    Summary

    .. raw:: html

       </summary>

    Body.

    .. raw:: html

       </details>

This is a correct conversion. However, using Pandoc 2.5, which is the version
of Pandoc that was being used by CI prior to this patch (the version of Pandoc
available in the package repository for Ubuntu 20.04), it converts as follows:

    .. raw:: html

       <details>

    Summary

    Body.

    .. raw:: html

       </details>

The <summary> tag is lost in this conversion.

This patch switches to a more recent version of Pandoc to fix this issue.
2022-09-16 19:29:48 -07:00
Hui Wen 06ed233a25 Error handling for rare classes (#455)
* error handling for rare classes

* change subtract to symmetric difference

* remove extra np.unique

* add warning for all instances of getting consensus labels

* error checking edits

* Add typing

Co-authored-by: Elías Snorrason <eliassno@gmail.com>

* black formatting

* update typing - labels_multiannotator will always already be converted to pd.dataframe

* make pred_probs options in typing

* add =None

* docstring edits

Co-authored-by: Jonas Mueller <1390638+jwmueller@users.noreply.github.com>

* add basic docstring

* Changed to verbose

* Removed unessesary calculation out of get_labels_quality_m

* Update cleanlab/multiannotator.py

* comment for lost classes check so it can be grepped

* caution about setting verbose to false

* advise against verbose=false in docstring

Co-authored-by: Elías Snorrason <eliassno@gmail.com>
Co-authored-by: Jonas Mueller <1390638+jwmueller@users.noreply.github.com>
Co-authored-by: Ulyana <ulyana@cleanlab.ai>
2022-09-16 19:26:29 -07:00
Anish Athalye 02ab55dff0 Add missing backticks and language annotation (#461) 2022-09-16 18:52:36 -07:00
Jonas Mueller 2eec20ea44 remove moderate dimension comment 2022-09-16 15:14:00 -07:00
Jonas Mueller 22facba6cc note that you can delete tutorials to build docs 2022-09-16 14:14:36 -07:00
Anish Athalye d8cc2e5056 Fix details disclosure elements in docs (#456)
This patch makes the following fixes:

- Make summary text appear on the same line as the ">" arrow marker;
  prior to this patch, it was being pushed down to the next line because
  there were nested block elements inside the <summary> element
- Style details element to visually delineate collapsible content with
  dashed lines above and below the content
- Add syntax highlighting for code blocks in details disclosure elements
  (some were missing syntax highlighting)
- Hide a cell that was meant to be hidden in the audio tutorial

The summary element looked ugly due to a block element being present
inside the <summary>. This was present in the rendered docs even though
it was not explicitly in the source. Even though our source (in a
Markdown cell in a Jupyter notebook) looked like:

    <summary>Example text</summary>

The rendered docs had:

    <summary><p>Example text</p></summary>

The easy fix was to leave this as-is and fix the styling with CSS,
making all elements inside the summary to be displayed as inline
elements.

Where was the extra <p> tag coming from? Different Markdown parsers
handle mixed Markdown/HTML differently. We are using nbsphinx, which
does something especially weird [1]: converting from Markdown ->
reStructuredText -> HTML.

For example, consider the following Markdown:

    <details><summary>Summary</summary>

    Body.

    </details>

nbsphinx was first converting it to this reST:

    .. raw:: html

       <details>

    .. raw:: html

       <summary>

    Summary

    .. raw:: html

       </summary>

    Body.

    .. raw:: html

       </details>

And then this reST was being converted to HTML. This is where the extra
<p> was coming from.

One workaround for this behavior is to switch to raw HTML cells in the
notebook, rather than Markdown cells, and write pure HTML there. This
has the disadvantage that it's inconvenient when the content inside the
<details> has extra markup: Markdown is very convenient for that (e.g.,
for styling text), and having the contents being parsed as Markdown also
allows us to easily use syntax highlighting inside the body.

Another workaround is to use raw reST cells [2] and write the proper
reST directly (avoiding the bad Markdown -> reST conversion). This
preserves the ability to use convenient formatting (though with reST
instead of Markdown) as well as syntax-highlighted code blocks. For
example:

    .. raw:: html

        <details><summary>Summary</summary>

    .. code-block:: python

        def meaning_of_life():
            return 42

    .. raw:: html

        </details>

The above snippet produces the expected HTML, with syntax-highlighted
code in the body, and without the extra <p> inside the <summary>.

Rather than either of these workarounds, the most convenient one for
developers is to fix the issue using CSS, so that the Markdown cells in
the tutorials can be left as-is and no special care is required when
writing details disclosure elements, which is what this patch does.

[1]: https://github.com/spatialaudio/nbsphinx/blob/fc79fd1ac5ab6df225b256ef4ca203c58c5ad92b/src/nbsphinx.py#L1309
[2]: https://nbsphinx.readthedocs.io/en/0.8.9/raw-cells.html#reST
2022-09-16 12:11:05 -07:00
Jonas Mueller a24dda5da8 clarify features for multiannotator tutorial 2022-09-16 11:22:02 -07:00
Jonas Mueller 7256cd3546 More improvements to token classification code and documentation (#452)
* improved token docs/code

* format paragraphs in docstrings

* fix typo

Co-authored-by: Elías Snorrason <eliassno@gmail.com>
2022-09-16 14:04:45 +00:00
Jonas Mueller 688c39c202 hide redundant display_example in audio tutorial 2022-09-16 04:09:15 -07:00
Jonas Mueller 5d900200e5 mention make_data in multiannotator tutorial 2022-09-16 03:46:03 -07:00
Jonas Mueller 2959210c95 more links in keras wrapper docstrings 2022-09-15 20:20:31 -07:00
Jonas Mueller 0657b14792 add links in keras wrapper docs 2022-09-15 19:20:37 -07:00
Elías Snorrason bc2dabb764 Change output of display_issues (#450) 2022-09-15 18:05:46 -07:00
Elías Snorrason 95b0742342 Make softmin_sentence_score a private function (#449)
This scoring function is only used internally. Might as well be private.
2022-09-15 23:19:15 +00:00
Elías Snorrason cdf6a147af ignore links to pradyunsg when validating HTML (#446) 2022-09-15 15:21:12 -07:00
Curtis G. Northcutt 1b813d9666 fix bug in hard-coded test. generalize the test (#448)
* fix bug in hard-coded test. generalize the test

* 🐛 cast rounded num_issues to int

np.rint outputs an array of the same shape and type as its input. num_label_issues is expected to return an integer.

Co-authored-by: Elías Snorrason <eliassno@gmail.com>
2022-09-15 18:16:56 -04:00
Jonas Mueller 1b76f4ff1b Improve docstrings for keras wrapper (#447)
* improved docstrings for keras wrapper

* hide inheritance from keras wrapper docstrings

* black formatting
2022-09-15 15:36:35 -04:00
Curtis G. Northcutt 3ff8fab2d9 make num_label_issues = cj calibrated offdiag sum (#445)
The discrepancy occurs because cj calibrated maintains a guarantee that it will perfectly count every example in the dataset (assumes no out of distribution examples).

You can see this when by following this change of methods:

* see `calibrate_confident_joint`, specifically this line here: https://github.com/cleanlab/cleanlab/blob/master/cleanlab/count.py#L172
* round here https://github.com/cleanlab/cleanlab/blob/9240a8c56d020abec8566a0a56d22dcb99d32528/cleanlab/internal/util.py#L209
* the actual rounding occurs here https://github.com/cleanlab/cleanlab/blob/9240a8c56d020abec8566a0a56d22dcb99d32528/cleanlab/internal/util.py#L174

the fix to make `num_label_issues` the same is just to round instead of flooring.

see the two GREEN columns in the attached image

> [nit] consider `np.rint()` instead of `np.round()` for clarity

good call. updated
2022-09-15 11:44:27 -07:00
Jonas Mueller 9240a8c56d rst file for keras wrapper 2022-09-15 10:08:12 -07:00
Elías Snorrason 5167d23b71 Update links to example notebooks (#444)
Related to cleanlab/examples#21
2022-09-15 11:10:33 -04:00
Jonas Mueller a4ad6460a2 Format return docstrings and add typing (#437)
* typing and return docstrings

* address typing complaints

* allow redefinition

* typing complains for pandas

* .values -> to_numpy()
2022-09-15 11:46:14 +00:00
Jonas Mueller 7ccdb5491f Add keras wrapper to docs (#443)
* Delete huggingface_keras_classifier.py

* Update keras.py

* readme language, remove huggingfacekerasclassifier

* language improvements

* reorder modules

* make keras.py appear in docs
2022-09-15 00:47:31 -07:00
Ulyana 61f650e357 Merge pull request #426 from ulya-tkch/ulya-outlier-array-like
Updated labels to allow array_like
2022-09-14 21:21:33 -07: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
Hui Wen d74dda0ed9 fix code and md inconsistency (#442) 2022-09-14 14:45:09 -07:00
Elías Snorrason cb5bfe8081 Add instructions for using sphinx-build (#441)
* 📝 add instructions for using sphinx-build

This is useful for building docs for un-committed changes.

* more clarification on uncommitted sphinx build

* another clarification that we dont have to commit

Co-authored-by: Jonas Mueller <1390638+jwmueller@users.noreply.github.com>
2022-09-14 13:23:47 -07:00
Hui Wen 5603b1c8a6 Extend KerasWrapper to Functional API (#434)
* add keras functional api wrapper

* add breif docstring

* minor unittest edit

* edit unittest

* update docstring

* make unittest less strict
2022-09-14 13:10:12 -07:00
Elías Snorrason 968310af37 Strip input prompts when copying code snippets (#439)
Configuration provided in https://sphinx-copybutton.readthedocs.io/en/latest/use.html#using-regexp-prompt-identifiers
2022-09-14 14:06:04 +00:00
Jonas Mueller 9b78b703d5 black formatting 2022-09-14 00:00:18 -07:00
Jonas Mueller bf000d551b update labels typing to be LabelLike 2022-09-13 23:55:35 -07:00
Hui Wen 7ab4cbbf23 minor docstring edits (#436) 2022-09-13 19:01:00 -07:00
Elías Snorrason 729c9f3068 Add autodoc-typehints extension for sphinx (#412)
* add autodoc-typehints extension for sphinx

With the extension: Function parameters are auto-tagged in docs, based on the function signatures.

Resolves #398

* disable use of :rtype: role by napoleon

output return type inline with description (https://sphinxcontrib-napoleon.readthedocs.io/en/latest/sphinxcontrib.napoleon.html#sphinxcontrib.napoleon.Config.napoleon_use_rtype)
2022-09-13 13:12:28 -07:00
Jonas Mueller 84af558e85 hide more code in image tutorial, organize imports 2022-09-13 12:39:43 -07:00
Jonas Mueller a9e3c0e5d2 emphasize features must be numeric 2022-09-13 09:37:21 -07:00
Jonas Mueller 6a0e3bc461 Improvements to token_classification tutorial (#419)
* edits to token tutorial

* fix typos

* given_labels -> labels in quickstart block

* add IOB2-formatting clarification

Co-authored-by: Elías Snorrason <eliassno@gmail.com>
2022-09-13 09:34:33 -07:00
Jonas Mueller b9ab4ba57b suppress tensorflow warning logs in tutorials if not properly installed (#432)
* remove ineffective TF suppression lines

* suppress tensorflow logs in workflows tutorial

* formatting

* hidden cell comment

* move suppress code to hidden cell

* move suppression code to first hidden cell

* move suppression code to first cell

* supress tf logs in tabular tutorial

* optional code to hidden cells in audio tutorial

* suppress tf logs in multiannotator tutorial

* suppress tf logs in token tutorial

* move cross-val tutorial to appear last

* move cross-val tutorial to be last in main index

* move outlier before multiannotator in API list

* remove newline at end of cell
2022-09-13 00:47:21 -07:00
Jonas Mueller 15899f8f20 try to suppress tensorflow logs pt2 (#431)
* move env variable setting before tf import

* suppress tf logs in faq
2022-09-12 18:03:00 -07:00
Ulyana 13d6cfc9ce Used internal function for typechecking labels 2022-09-12 16:54:07 -07:00
Jonas Mueller a0276ca587 Text tutorial improvements (#429)
* more tf supression

* formatting

* move imports to top
2022-09-11 14:46:04 -07:00
Elías Snorrason 9a109182b1 Update argument given_labels -> labels in token classification module (#423)
* given_labels -> labels

only applies to the argument to `display_issues`

Fixes #418

* update kwargs in test for display_issues

* apply black formatter
2022-09-11 12:38:38 -07:00
Jonas Mueller f7102db902 Add links to examples notebooks where appropriate (#428)
* links to OOD examples notebook

* iterative notebook title in its link
2022-09-11 12:24:51 -07:00
Jonas Mueller c307e9714f update workflows for post 2.0 (#427)
* update workflows for post 2.0

* formatting

* link for cleanlearning
2022-09-11 00:27:57 -07:00
Ulyana a6fb96f082 Add test 2022-09-09 16:58:42 -07:00
Ulyana 5243b48b00 Updated labels to array_like (list is ok) 2022-09-09 16:21:29 -07:00
Ulyana 43a795cb0c Update DEVELOPMENT.md with Relative Linking (#425)
* Update DEVELOPMENT.md with Relative Linking

Added instructions for relative linking between docs and tutorials

* more link instructions

Co-authored-by: Jonas Mueller <1390638+jwmueller@users.noreply.github.com>
2022-09-09 15:43:11 -07:00