Answers.Body: <p>Precision and Recall are concepts that have been introduced in the field of information retrieval. Imagine you have a large set of documents, and you want to find the ones that are relevant to a particular issue.</p>
  <p>You can be sure to find <em>all</em> relevant documents if you simply return the whole lot -- you won't miss a single relevant document. So your recall is 1.0, the maximum: you got all the relevant ones. That you also got a large number of irrelevant ones is not important for recall, but means your query wasn't very efficient (and actually quite pointless!).</p>
  <p>If you do get all documents, your precision will be low: the number of retrieved documents that are relevant is the same, but the denominator is now much bigger, and depending on how many relevant documents there are, your precision value is small.</p>
  <p>The opposite extreme is to not return any documents: Now your precision is high (effectively infinite, as it is zero divided by zero), but your recall is zero (as you don't get any relevant documents).</p>
  <p>So in an ideal world, you want to optimise both precision and recall (which is why usually a third metric is used which combines the two, the <a href="https://en.wikipedia.org/wiki/F-score" rel="nofollow noreferrer">F-Score</a>.</p>
  <p>Now, you can only calculate precision and recall if you know what the correct values are already, so you need to know how many documents are relevant. Obviously you will need to have inspected all documents to decide whether they are relevant to your issue or not. This is usually a subjective value judgment, as relevance tends to be non-binary. If I'm looking for articles on the efficiency of petrol engines, will those about Diesel engines be relevant? Probably, if you're looking at a general dataset. But if the documents are all about the efficiency of different types of engines, then I would most likely not be interested in those about Diesel engines.</p>
  <p>From Information Retrieval, the concepts of precision and recall have been generalised to any binary classification tasks, where you can judge the quality of the classification by using these metrics. So you might come across situations where the 'relevance' criterion is more objective than whether a document is relevant to a certain topic. But that depends on the context of what you are classifying.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-09-01T12:09:14.813Z
Answers.LastActivityDate: 2021-09-01T12:09:14.813Z
Answers.UserDisplayName: Oliver Mason
Answers.Body: <p>It means precisely the same as true/false positive and true/false negative in the classic formulation of precision, recall, F-score for classification tasks.</p>
  <ul>
  <li>relevant and retrieved: true positive</li>
  <li>relevant and not retrieved: false positive</li>
  <li>not relevant and retrieved: false negative</li>
  <li>not relevant and not retrieved: true negative</li>
  </ul>
  <p>And yes, the relevance depends on the task you're performing. To make an example, you might be interested in classifying, through sentiment analysis, offensive vs nonoffensive tweets. In this case, you'll have:</p>
  <ul>
  <li>relevant and retrieved: offensive tweets labeled as such</li>
  <li>relevant and not retrieved: offensive tweets labeled as nonoffensive</li>
  <li>not relevant and retrieved: nonoffensive tweets labeled as offensive</li>
  <li>not relevant and not retrieved: nonoffensive tweets labeled as such</li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-09-01T00:58:24.517Z
Answers.Text: So, is labelling assumed?
Answers.UserDisplayName: hanugm
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-09-01T07:56:59.137Z
Answers.Text: yes, if you want to compute precision and recall you need to know for what you're computing them.
Answers.UserDisplayName: Edoardo Guerriero
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-08-31T12:29:24.110Z
Answers.LastActivityDate: 2021-09-09T13:02:20.113Z
Answers.LastEditDate: 2021-09-09T13:02:20.113Z
Answers.UserDisplayName: Edoardo Guerriero
Body: <p>In natural language processing, I came across the concept of &quot;relevant document&quot; several times. And several analytical formulas, such as precision, recall are based on the relevant documents.</p>
  <p>Precision = <span class="math-container">$\dfrac{\text{Number of documents that are relevant and retrieved to the query Q}}{\text{Number of retrieved documents to the query Q}}$</span></p>
  <p>Recall = <span class="math-container">$\dfrac{\text{Number of documents that are relevant and retrieved to the query Q}}{\text{Number of relevant documents to the query Q}}$</span></p>
  <p>What is meant by &quot;relevance&quot; in such cases? Is it a universally objective term or subjective term, decided by the designer, based on that particular context?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-09-02T16:45:20.027Z
Comments.Text: It means the things you are looking for.
Comments.UserDisplayName: Criticize SE actions means ban
Tags: <natural-language-processing><terminology><precision><recall><information-retrieval>
Title: What is meant by a "relevant document" in NLP?
UserDisplayName: hanugm
ThreadText: # What is meant by a "relevant document" in NLP?
  
  (Asked by: username_0 on 2021-08-31)
  
  In natural language processing, I came across the concept of "relevant document" several times. And several analytical formulas, such as precision, recall are based on the relevant documents.
  
  Precision = $\dfrac{\text{Number of documents that are relevant and retrieved to the query Q}}{\text{Number of retrieved documents to the query Q}}$
  
  Recall = $\dfrac{\text{Number of documents that are relevant and retrieved to the query Q}}{\text{Number of relevant documents to the query Q}}$
  
  What is meant by "relevance" in such cases? Is it a universally objective term or subjective term, decided by the designer, based on that particular context?
  
  **Tags:** natural-language-processing, terminology, precision, recall, information-retrieval
  
  > **Comments:**
  > **username_1**: It means the things you are looking for.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2021-09-01. Score: 1
  
  Precision and Recall are concepts that have been introduced in the field of information retrieval. Imagine you have a large set of documents, and you want to find the ones that are relevant to a particular issue.
  
  You can be sure to find *all* relevant documents if you simply return the whole lot -- you won't miss a single relevant document. So your recall is 1.0, the maximum: you got all the relevant ones. That you also got a large number of irrelevant ones is not important for recall, but means your query wasn't very efficient (and actually quite pointless!).
  
  If you do get all documents, your precision will be low: the number of retrieved documents that are relevant is the same, but the denominator is now much bigger, and depending on how many relevant documents there are, your precision value is small.
  
  The opposite extreme is to not return any documents: Now your precision is high (effectively infinite, as it is zero divided by zero), but your recall is zero (as you don't get any relevant documents).
  
  So in an ideal world, you want to optimise both precision and recall (which is why usually a third metric is used which combines the two, the [F-Score](https://en.wikipedia.org/wiki/F-score).
  
  Now, you can only calculate precision and recall if you know what the correct values are already, so you need to know how many documents are relevant. Obviously you will need to have inspected all documents to decide whether they are relevant to your issue or not. This is usually a subjective value judgment, as relevance tends to be non-binary. If I'm looking for articles on the efficiency of petrol engines, will those about Diesel engines be relevant? Probably, if you're looking at a general dataset. But if the documents are all about the efficiency of different types of engines, then I would most likely not be interested in those about Diesel engines.
  
  From Information Retrieval, the concepts of precision and recall have been generalised to any binary classification tasks, where you can judge the quality of the classification by using these metrics. So you might come across situations where the 'relevance' criterion is more objective than whether a document is relevant to a certain topic. But that depends on the context of what you are classifying.
  
  
  ---
  
  ### Answer by username_3 on 2021-08-31. Score: 1
  
  It means precisely the same as true/false positive and true/false negative in the classic formulation of precision, recall, F-score for classification tasks.
  
  * relevant and retrieved: true positive
  * relevant and not retrieved: false positive
  * not relevant and retrieved: false negative
  * not relevant and not retrieved: true negative
  
  And yes, the relevance depends on the task you're performing. To make an example, you might be interested in classifying, through sentiment analysis, offensive vs nonoffensive tweets. In this case, you'll have:
  
  * relevant and retrieved: offensive tweets labeled as such
  * relevant and not retrieved: offensive tweets labeled as nonoffensive
  * not relevant and retrieved: nonoffensive tweets labeled as offensive
  * not relevant and not retrieved: nonoffensive tweets labeled as such
  
  > **Comments:**
  > **username_0**: So, is labelling assumed?  
  > **username_3**: yes, if you want to compute precision and recall you need to know for what you're computing them.  
  
  ---
  
  