0
$\begingroup$

I am playing around with topic modeling, and I notice a lot of related plural and singular words in my corpus (e.g. 'champion' and 'champions' are both found).

I gave the porter stemmer in NLTK a shot, but full-on stemming removes a lot of other details that I would like to retain.

Is there a way to depluralize terms using python?

$\endgroup$
  • $\begingroup$ I'm voting to close this question as off-topic because It is not related to any topic on CV. $\endgroup$ – Michael R. Chernick Feb 1 '17 at 16:05
  • $\begingroup$ Questions about how to use software (eg, Python) are generally off topic here. A software-neutral text mining question about how to handle stemming issues when you want to preserve other details (what?) might be worthwhile, though. $\endgroup$ – gung - Reinstate Monica Feb 1 '17 at 16:49
  • $\begingroup$ (Note that this question would also be off topic on Stack Overflow.) $\endgroup$ – gung - Reinstate Monica Feb 1 '17 at 16:50
  • 1
    $\begingroup$ I figured this would be considered to machine learning, since it is about the transformation of text into features. If this is off topic here and on stack overflow, is there a better place to ask this that you would suggest? $\endgroup$ – neelshiv Feb 3 '17 at 14:44
1
$\begingroup$

Maybe try a regex stemming using nltk.stem.regexp.RegexpStemmer.

stemmer = RegexpStemmer('s$|ies$') 

I'm sure this won't cover all the cases you'd like, and there are a lot of nuances with plural words, but you can customize this however you want to adjust for your scenarios.

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.