mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-10 19:57:17 +03:00
Fix unicode strings in examples [ci skip]
This commit is contained in:
parent
8d3de90bc4
commit
5e59c9b3ee
|
@ -197,7 +197,7 @@ path to the model data directory.
|
||||||
```python
|
```python
|
||||||
import spacy
|
import spacy
|
||||||
nlp = spacy.load("en_core_web_sm")
|
nlp = spacy.load("en_core_web_sm")
|
||||||
doc = nlp(u"This is a sentence.")
|
doc = nlp("This is a sentence.")
|
||||||
```
|
```
|
||||||
|
|
||||||
You can also `import` a model directly via its full name and then call its
|
You can also `import` a model directly via its full name and then call its
|
||||||
|
@ -208,7 +208,7 @@ import spacy
|
||||||
import en_core_web_sm
|
import en_core_web_sm
|
||||||
|
|
||||||
nlp = en_core_web_sm.load()
|
nlp = en_core_web_sm.load()
|
||||||
doc = nlp(u"This is a sentence.")
|
doc = nlp("This is a sentence.")
|
||||||
```
|
```
|
||||||
|
|
||||||
📖 **For more info and examples, check out the
|
📖 **For more info and examples, check out the
|
||||||
|
|
|
@ -91,8 +91,8 @@ def demo(shape):
|
||||||
nlp = spacy.load("en_vectors_web_lg")
|
nlp = spacy.load("en_vectors_web_lg")
|
||||||
nlp.add_pipe(KerasSimilarityShim.load(nlp.path / "similarity", nlp, shape[0]))
|
nlp.add_pipe(KerasSimilarityShim.load(nlp.path / "similarity", nlp, shape[0]))
|
||||||
|
|
||||||
doc1 = nlp(u"The king of France is bald.")
|
doc1 = nlp("The king of France is bald.")
|
||||||
doc2 = nlp(u"France has no king.")
|
doc2 = nlp("France has no king.")
|
||||||
|
|
||||||
print("Sentence 1:", doc1)
|
print("Sentence 1:", doc1)
|
||||||
print("Sentence 2:", doc2)
|
print("Sentence 2:", doc2)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user