Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define endpoint explicitly in README examples #39

Open
ablaette opened this issue Feb 27, 2024 · 1 comment
Open

Define endpoint explicitly in README examples #39

ablaette opened this issue Feb 27, 2024 · 1 comment

Comments

@ablaette
Copy link
Contributor

This is a nice example in the README:

inaugural_paragraphs <- data_corpus_inaugural |>
  corpus_subset(Year > 1970) |>
  corpus_reshape(to = "paragraphs")
uritab_paragraphs <- get_dbpedia_uris(
  x = inaugural_paragraphs,
  language = getOption("dbpedia.lang"),
  max_len = 5600L,
  confidence = 0.5,
  api = getOption("dbpedia.endpoint"),
  verbose = FALSE,
  progress = FALSE
)

But if I run this on my local machine with the "German" DBpedia Spotlight container running, I will process the data with a German model, resulting in fuzzy results. On the CI test machines, tests would use the remote English endpoint, so results would be "correct", yet different.

So I suggest to set the endpoint and the language explicitly in this example:

uritab_paragraphs <- get_dbpedia_uris(
  x = inaugural_paragraphs,
  language = "en",
  max_len = 5600L,
  confidence = 0.5,
  api = "http://api.dbpedia-spotlight.org/en/annotate",
  verbose = FALSE,
  progress = FALSE
)
@ChristophLeonhardt
Copy link
Collaborator

Defining the endpoint here would be better, I agree. The assumption that an "English" endpoint is used can be wrong. This is not accounted for in the examples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants