title: How to Calculate Precision, Recall, and F1 for Entity Prediction
body: <p>I used an Entity Linking Model from <a href="https://github.com/facebookresearch/BLINK" rel="nofollow noreferrer">Github</a> to predict a set of documents. Since they do not actually explain how to calculate precision, recall, and F1. So I created a dataframe by using the actual tag and predict tag from the testing data.</p>
  <pre><code> Actual           Predict
  security          security
  london             london
    UK                 US
    :                   :
    :                   :
  domain              menu
  sushi               soso
  tom                jerry
  </code></pre>
  <p>I am wondering based on this, will I be able to calculate the precision, recall, and f1 on my own and if I can, how can I do it? Thanks!</p>