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

Maximum length of token length #248

Closed
ginward opened this issue Sep 23, 2021 · 2 comments
Closed

Maximum length of token length #248

ginward opened this issue Sep 23, 2021 · 2 comments

Comments

@ginward
Copy link

ginward commented Sep 23, 2021

In SentenceTransformer (and most transformer-based models), the maximum length of a document is 512 tokens.

I was wondering if there is a similar document length restrictions in BERTopic?

Thanks!

@ginward
Copy link
Author

ginward commented Sep 23, 2021

This is related to #114

@MaartenGr
Copy link
Owner

The token restrictions only apply to the embedding technique that you use. In your case, that would depend on the SentenceTransformer model that you are using. Moreover, if you were to use Flair or Huggingface Transformer embeddings, then you might run into token limits if you are not careful.

In general, it should not be an issue as long as you are not going too far over the limit. The thing is with going too far over the limit is that the document representation gets vague. In those cases, I would advise splitting your documents into sentences.

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