<p>You can use feature selection for your data. some good feature selection can reduce features up to 90% and persist the classification performance.
In feature selection you select top feature(in <strong>Bag Of Word</strong> model, you select top influence words), and train model based on these words(features). this reduce the dimension of your data(also it prevent Curse Of Dimensionality)
here is a good survey:
<a href="https://arxiv.org/pdf/1602.02850.pdf" rel="nofollow">Survey on feature selection</a></p>

<p>In Brief:</p>

<p>Two feature selection approach is available: Filtering and Wrapping</p>

<p>Filtering approach is almost based on information theory. search "Mutual Information", "chi2" and... for this type of feature selection</p>

<p>Wrapping approach use the classification algorithm to estimate the most important features in the library. for example you select some words and evaluate classification performance(recall,precision).</p>

<p>Also some others approch can be usefull. LSA and LSI can outperform the classification performance and time:
<a href="https://en.wikipedia.org/wiki/Latent_semantic_analysis" rel="nofollow">https://en.wikipedia.org/wiki/Latent_semantic_analysis</a></p>

<p>You can use sickit for feature selection and LSA:</p>

<p><a href="http://scikit-learn.org/stable/modules/feature_selection.html" rel="nofollow">http://scikit-learn.org/stable/modules/feature_selection.html</a></p>

<p><a href="http://scikit-learn.org/stable/modules/decomposition.html" rel="nofollow">http://scikit-learn.org/stable/modules/decomposition.html</a></p>
Text classification performance
<p>So i am using textblob python library, but the performance is lacking.</p>

<p>I already serialize it and load it before the loop( using pickle ).</p>

<p>It currently takes ~ 0.1( for small training data ) and ~ 0.3 on 33'000 test data. I need to make it faster, is it even possible ?</p>

<h1><strong>Some code:</strong></h1>

<pre><code># Pass trainings before loop, so we can make performance a lot better
trained_text_classifiers = load_serialized_classifier_trainings(config["ALL_CLASSIFICATORS"])

# Specify witch classifiers are used by witch classes
filter_classifiers = get_classifiers_by_resource_names(trained_text_classifiers, config["FILTER_CLASSIFICATORS"])
signal_classifiers = get_classifiers_by_resource_names(trained_text_classifiers, config["SIGNAL_CLASSIFICATORS"])

for (url, headers, body) in iter_warc_records(warc_file, **warc_filters):
    start_time = time.time()
    body_text = strip_html(body);

    # Check if url body passess filters, if yes, index, if no, ignore
    if Filter.is_valid(body_text, filter_classifiers):
        print "Indexing", url.url
        resp = indexer.index_document(body, body_text, signal_classifiers, url=url, headers=headers, links=bool(args.save_linkgraph_domains))
    else:
        print "\n"
        print "Filtered out", url.url
        print "\n"
        resp = 0
</code></pre>

<p>This is the loop witch performs check on each of the warc file's body and metadata.</p>

<p>there are 2 text classification checks here.</p>

<p>1) In Filter( very small training data ):</p>

<pre><code>if trained_text_classifiers.classify(body_text) == "True":
        return True
    else:
        return False
</code></pre>

<p>2) In index_document( 33'000 training data ):</p>

<pre><code>prob_dist = trained_text_classifier.prob_classify(body)
        prob_dist.max()

        # Return the propability of spam
        return round(prob_dist.prob("spam"), 2)
</code></pre>

<p>The classify and prob_classify are the methods that take the tool on performance.</p>