Skip to content

Commit

Permalink
Add examples and description in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ophelielacroix committed Nov 23, 2020
1 parent 6d68e2d commit bdf0dcc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
14 changes: 9 additions & 5 deletions docs/docs/gettingstarted/quickstart.md
Expand Up @@ -40,17 +40,21 @@ nlp = load_spacy_model()

# Parse the text using the spaCy model
# it creates a spaCy Doc object
doc = nlp("Jeg er en sætning, der skal analyseres")
doc = nlp("Niels Henrik David Bohr var en dansk fysiker fra København")

# prepare some pretty printing
features = ['Text','POS', 'Dep']
features = ['Text','POS', 'Dep', 'NE']
head_format ="\033[1m{!s:>11}\033[0m" * (len(features) )
row_format ="{!s:>11}" * (len(features) )

print(head_format.format(*features))
# printing for each token in the docs the pos and dep features
# printing for each token in the docs the pos, dep and entity features
for token in doc:
print(row_format.format(token.text, token.pos_, token.dep_))
print(row_format.format(token.text, token.pos_, token.dep_, token.ent_type_))

# printing the list of entities (and their category)
for ent in doc.ents:
print(ent.text, '-', ent.label_)

```

Expand Down Expand Up @@ -95,7 +99,7 @@ text = "Jeg er meget glad med DaNLP"
doc = nlpS(text)

# print the most probable category among 'positiv', 'negativ' or 'neutral'
print(max(doc.cats))
print(max(doc.cats, key=doc.cats.get))
```


Expand Down
4 changes: 3 additions & 1 deletion docs/docs/tasks/pos.md
@@ -1,6 +1,8 @@
Part of Speech Tagging
======================
This section is concerned with public available Part of Speech (POS) taggers in Danish.
This section is concerned with public available Part of Speech (POS) taggers in Danish.

Part-of-speech tagging is the task of classifying words into their part-of-speech, based on both their definition and context. Parts of speech are also known as word classes, which describe the role of the words in sentences relatively to their neighbors (such as verbs and nouns).

| Model | Train Data | License | Trained by | Tags | DaNLP |
|-----------------------|---------------------------------------------------------------------------|---------------|---------------------|------------------------------|-------|
Expand Down

0 comments on commit bdf0dcc

Please sign in to comment.