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

Speeding up processing #8

Open
Jonesn11 opened this issue Oct 22, 2020 · 0 comments
Open

Speeding up processing #8

Jonesn11 opened this issue Oct 22, 2020 · 0 comments

Comments

@Jonesn11
Copy link

Jonesn11 commented Oct 22, 2020

I have a dataframe with 230000 rows and when I apply the empath lexicon it s taking a while to process.
What is the best way to speed it up?

The main operation I have looks like:

from empath import Empath
emp = Empath()
analyze = lru_cache(maxsize=50000)(emp.analyze)
all_posts['empath'] = all_posts.content.apply(lambda x: list(analyze(' '.join(x)).values()))

Where all_posts.content is a series of token lists

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