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

Add options to load full documents as Sentence objects #3595

Merged
merged 2 commits into from
Jan 11, 2025

Conversation

alanakbik
Copy link
Collaborator

This PR adds two new parameters to ColumnCorpus and ColumnDataset to enable more customization in handling document boundaries.

documents_as_sentences: If set to True and a document_separator_token is also set, the corpus will create one sentence object not for each sentence, but for each document in the corpus.

every_sentence_is_independent: If set to True, the corpus will consider each sentence independent. This means that loaded sentences cannot expand their context beyond the sentence boundary. This is useful for corpora that store independent sentences, like tweets.

@alanakbik alanakbik merged commit ba41223 into master Jan 11, 2025
2 checks passed
@alanakbik alanakbik deleted the documents_as_sentences branch January 11, 2025 15:28
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

Successfully merging this pull request may close these issues.

1 participant