0
votes

I am just starting out with nltk, and I am following the book. Chapter six is about text classification, and i am a bit confused about something. In the examples (the names, and movie reviews) the classifier is trained to select between two well-defined labels (male-female, and pos-neg). But how to train if you have only one label.

Say I have a bunch of movie plot outlines, and I am only interested in fishing out movies from the sci-fi genre. Can I train a classifier to only recognize sci-fi plots, en say f.i. if classification confidence is > 80%, then put it in the sci-fi group, otherwise, just ignore it.

Hope somebody can clarify, thank you,

2
You should usually classify as positive at >.5, not .8. - Fred Foo

2 Answers

0
votes

You can simply train a binary classifier to distinguish between sci-fi and not sci-fi

So train on the movie plots that are labeled as sci-fi and also on a selection of all other genres. It might be a good idea to have a representative sample of the same size for the other genres such that not all are of the romantic comedy genre, for instance.

0
votes

I see two questions

  1. How to train the system?
  2. Can the system consist of "sci-fi" and "others"?

The answer to 2 is yes. Having a 80% confidence threshold idea also makes sense, as long as you see with your data, features and algorithm that 80% is a good threshold. (If not, you may want to consider lowering it if not all sci-fi movies are being classified as sci-fi, or lowering it, if too many non-sci-fi movies are being categorized as sci-fi.)

The answer to 1 depends on the data you have, the features you can extract, etc. Jared's approach seems reasonable. Like Jared, I'd also to emphasize the importance of enough and representative data.