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

Bring textmodel methods and textplot_scale1d to quanteda? #13

Open
koheiw opened this issue Feb 19, 2020 · 2 comments
Open

Bring textmodel methods and textplot_scale1d to quanteda? #13

koheiw opened this issue Feb 19, 2020 · 2 comments

Comments

@koheiw
Copy link
Collaborator

koheiw commented Feb 19, 2020

My LSS and newsmap package uses textmodel methods such as as.coefficients_textmodel() and textplot_scale1d(), but I do not want to add quanteda.textmodels to their dependency. How about bringing back these functions to quanteda? This helps other people to write their own textmodel's based on our package.

@kbenoit
Copy link
Contributor

kbenoit commented Feb 19, 2020

That’s a fine idea, and whatever we can do to make it extensible or more general-purpose is something I’d like to develop. One though is to provide a way for all textmodel_*() functions to work on any sparse matrix, either from Matrix or slam, of course in addition to a dfm. Another is via integrating the predictive models with caret (or tidymodels/hardhat) as in quanteda/quanteda.textmodels#8.

Point me to the code in LSS and newsmap and we can start with yours.

@koheiw
Copy link
Collaborator Author

koheiw commented Feb 20, 2020

LSS

It extends textplot_scale1d:
https://github.com/koheiw/LSS/blob/e8fad83759ad3d9647f19be7edc6715c95fc00cb/R/textplot.R#L74-L95

Also, as.coefficients_textmodel():
https://github.com/koheiw/LSS/blob/e8fad83759ad3d9647f19be7edc6715c95fc00cb/R/textmodel.R#L242

The package no longer builds with quaneda v2.0. I am planing to submit this to CRAN sometime this year.

newsmap

It is already on CRAN. Not affected much because it does a lot of DYI, but it should use more functions made available in quaneda.
https://github.com/koheiw/newsmap/blob/master/R/textmodel_newsmap.R

@kbenoit kbenoit transferred this issue from quanteda/quanteda.textmodels Feb 17, 2021
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