Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/stanfordnlp/stanza.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMr.Tan <admin@itrhx.com>2021-03-09 06:33:05 +0300
committerGitHub <noreply@github.com>2021-03-09 06:33:05 +0300
commitc3608dc2dec38268a6d9bba033764614f7736df2 (patch)
tree4a167a948dc7bdea6347b3075dc48a8936816849 /README.md
parent90ee5c45bfd85ef594594a1ecedb37babd76e176 (diff)
Add proxies parameters when downloading the model (#638)
* Add proxies
Diffstat (limited to 'README.md')
-rw-r--r--README.md11
1 files changed, 11 insertions, 0 deletions
diff --git a/README.md b/README.md
index 01c52689..ee60b49b 100644
--- a/README.md
+++ b/README.md
@@ -105,6 +105,17 @@ To run your first Stanza pipeline, simply following these steps in your Python i
>>> doc.sentences[0].print_dependencies()
```
+If you encounter `requests.exceptions.ConnectionError`, please try to use a proxy:
+
+```python
+>>> import stanza
+>>> proxies = {'http': 'http://ip:port', 'https': 'http://ip:port'}
+>>> stanza.download('en', proxies=proxies) # This downloads the English models for the neural pipeline
+>>> nlp = stanza.Pipeline('en') # This sets up a default neural pipeline in English
+>>> doc = nlp("Barack Obama was born in Hawaii. He was elected president in 2008.")
+>>> doc.sentences[0].print_dependencies()
+```
+
The last command will print out the words in the first sentence in the input string (or [`Document`](https://stanfordnlp.github.io/stanza/data_objects.html#document), as it is represented in Stanza), as well as the indices for the word that governs it in the Universal Dependencies parse of that sentence (its "head"), along with the dependency relation between the words. The output should look like:
```