title: How to encode a string data for classification ML model in Python
body: <p>This is for a project I am doing for a course on freecodecamp. The project is about SMS Classification, which can detect whether a certain message is a spam or not.</p>
  <p>I am not able to encode the string data in order for it to be suitable and working in the ML Model.</p>
  <p>Here is an example of my training data with column values, after seperation:
  <a href="https://i.stack.imgur.com/3RTYN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3RTYN.png" alt="Error" /></a></p>
  <p>The error I am receiving is:</p>
  <pre><code>ValueError: Received a feature column from TensorFlow v1, but this is a TensorFlow v2 Estimator. Please either use v2 feature columns (accessible via tf.feature_column.* in TF 2.x) with this Estimator, or switch to a v1 Estimator for use with v1 feature columns (accessible via tf.compat.v1.estimator.* and tf.compat.v1.feature_column.*, respectively.
  </code></pre>
  <p>However, I am restricted to using the v2 TensorFlow Estimator. Is there no way to make it compatible with each other?</p>
  <p>Also this is supposedly where the error is being generated.
  <a href="https://i.stack.imgur.com/xQoV6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xQoV6.png" alt="The line that is generating the error" /></a></p>
  <p>What exactly am I doing wrong in this scenario?</p>