title: How does pipeline work for nlp tasks and what do the accuracy scores imply
body: <p>[First I would like to thank the community of SO; for whose support I could actually finish making an end to end data science project (including deployment.)]</p>
  <p>Over to my question.</p>
  <p>I wanted to create an app that will predict success or failure depending upon textual input data.</p>
  <p>In order to construct the model; instead of developing an algorithm from scratch; I used existing algorithms instead.</p>
  <p>While training my dataframe [which is a textual corpus]; I frequently wrote:</p>
  <pre><code>pipeline = Pipeline(
  [
      (&quot;vect&quot;, CountVectorizer()),
      (&quot;tfidf&quot;, TfidfTransformer()),
      (&quot;clf&quot;, my_chosen_model()),
  ]
  )
  </code></pre>
  <p>That is because I saw several code examples doing so. I however, didn't clearly understand the usage of pipeline. Can anyone please explain it (or share any link which can help people like me from non-programming backgrounds understand it better.)</p>
  <p>After completing my experiments I obtained accuracy scores on text data:</p>
  <pre><code>RandomForest    SVM    MLP    MultinomialNB
  0.80            0.85   0.86    0.80
  </code></pre>
  <p>When I increased the number of data (from initial 20000 to 50000), accuracy scores were:</p>
  <pre><code>RandomForest    SVM    MLP    MultinomialNB
  0.85            0.85   0.87    0.82
  </code></pre>
  <p>I also tried BERT; which gave an accuracy of : 0.72 on text data.</p>
  <p>Can someone please explain to me here:</p>
  <ol>
  <li><p>Why BERT performed so low - despite that BERT is preferred by many. I followed the exact steps as mentioned here for my task: <a href="https://www.analyticsvidhya.com/blog/2020/07/transfer-learning-for-nlp-fine-tuning-bert-for-text-classification/" rel="nofollow noreferrer">https://www.analyticsvidhya.com/blog/2020/07/transfer-learning-for-nlp-fine-tuning-bert-for-text-classification/</a></p>
  </li>
  <li><p>What do the accuracy scores imply about different algorithms in regards to data? And will it be wise to choose either MLP / SVM or choose Random forest due to a jump in performance.</p>
  </li>
  </ol>