Skip to content

Commit

Permalink
Merge pull request #340 from sondalex/update_documentation
Browse files Browse the repository at this point in the history
Fix docstrings example module import error & Add doctrings missing imports
  • Loading branch information
HLasse authored Apr 9, 2024
2 parents 7d278d5 f33a28d commit 7064c3b
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/textdescriptives/components/coherence.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 138,7 @@ def create_coherence_component(nlp: Language, name: str) -> Callable[[Doc], Doc]
Examples:
>>> import spacy
>>> import textdescriptives as td
>>> nlp = spacy.load("en_core_web_md")
>>> nlp.add_pipe("textdescriptives/coherence")
>>> # apply the pipeline to a text
Expand Down
1 change: 1 addition & 0 deletions src/textdescriptives/components/dependency_distance.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 132,7 @@ def create_dependency_distance_component(
Example:
>>> import spacy
>>> import textdescriptives as td
>>> nlp = spacy.load("en_core_web_sm")
>>> nlp.add_pipe("textdescriptives/dependency_distance")
>>> # apply the pipeline to a text
Expand Down
1 change: 1 addition & 0 deletions src/textdescriptives/components/descriptive_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 224,7 @@ def create_descriptive_stats_component(
Example:
>>> import spacy
>>> import textdescriptives as td
>>> nlp = spacy.blank("en")
>>> # add sentencizer
>>> nlp.add_pipe("sentencizer")
Expand Down
3 changes: 2 additions & 1 deletion src/textdescriptives/components/information_theory.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 173,8 @@ def create_information_theory_component(nlp: Language, name: str) -> Information
Example:
>>> import spacy
>>> nlp = spacy.blank('en_core_web_lg')
>>> import textdescriptives as td
>>> nlp = spacy.blank('en')
>>> nlp.add_pipe('textdescriptives/information_theory')
>>> doc = nlp('This is a sentence.')
>>> doc._.information_theory
Expand Down
1 change: 1 addition & 0 deletions src/textdescriptives/components/pos_proportions.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 105,7 @@ def create_pos_proportions_component(
Example:
>>> import spacy
>>> import textdescriptives as td
>>> nlp = spacy.load("en_core_web_sm")
>>> nlp.add_pipe("textdescriptives/pos_proportions")
>>> # apply the component to a document
Expand Down
2 changes: 1 addition & 1 deletion src/textdescriptives/components/quality.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 652,7 @@ def create_quality_component(
Example:
>>> import spacy
>>> from spacy_quality import Quality
>>> nlp = spacy.blank(("en_core_web_sm")
>>> nlp = spacy.blank("en")
>>> nlp.add_pipe("quality")
>>> doc = nlp("This is a test")
>>> # extract quality metrics
Expand Down

0 comments on commit 7064c3b

Please sign in to comment.