From a784b12eff48df9281b184cb7005e66bbd2e3aca Mon Sep 17 00:00:00 2001 From: ColleterVi <36503688+ColleterVi@users.noreply.github.com> Date: Thu, 13 Jan 2022 12:25:06 +0100 Subject: [PATCH] fix: new restcountries url (#10043) Url extension "eu" and path "rest" are no longer available. Replacing them for a working url. --- website/docs/usage/processing-pipelines.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/docs/usage/processing-pipelines.md b/website/docs/usage/processing-pipelines.md index 0264a2825..11fd1459d 100644 --- a/website/docs/usage/processing-pipelines.md +++ b/website/docs/usage/processing-pipelines.md @@ -1479,7 +1479,7 @@ especially useful it you want to pass in a string instead of calling ### Example: Pipeline component for GPE entities and country meta data via a REST API {#component-example3} This example shows the implementation of a pipeline component that fetches -country meta data via the [REST Countries API](https://restcountries.eu), sets +country meta data via the [REST Countries API](https://restcountries.com), sets entity annotations for countries and sets custom attributes on the `Doc` and `Span` – for example, the capital, latitude/longitude coordinates and even the country flag. @@ -1495,7 +1495,7 @@ from spacy.tokens import Doc, Span, Token @Language.factory("rest_countries") class RESTCountriesComponent: def __init__(self, nlp, name, label="GPE"): - r = requests.get("https://restcountries.eu/rest/v2/all") + r = requests.get("https://restcountries.com/v2/all") r.raise_for_status() # make sure requests raises an error if it fails countries = r.json() # Convert API response to dict keyed by country name for easy lookup