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

consider adding as_conll2002 #15

Open
jwijffels opened this issue Dec 10, 2020 · 0 comments
Open

consider adding as_conll2002 #15

jwijffels opened this issue Dec 10, 2020 · 0 comments

Comments

@jwijffels
Copy link
Contributor

jwijffels commented Dec 10, 2020

as_conll2002 <- function(x, sep = "\t"){
  ## Each word has been put on a separate line and there is an empty line after each sentence.
  id <- udpipe::unique_identifier(x, fields = intersect(c("doc_id", "paragraph_id", "sentence_id"), colnames(x)))
  add <- ifelse(!duplicated(id), "\n\n", "\n")
  add[1] <- ""
  word   <- x$token
  entity <- x$chunk_entity
  sprintf("%s%s%s%s", add, word, sep, entity)
}
cat(as_conll2002(head(x, 100)))

to be used in training based on bertje

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

1 participant