readme: ---
  
  language: en
  license: mit
  tags:
  - keyphrase-extraction
  datasets:
  - midas/openkp
  metrics:
  - seqeval
  widget:
  - text: "Keyphrase extraction is a technique in text analysis where you extract the important keyphrases from a document. 
  Thanks to these keyphrases humans can understand the content of a text very quickly and easily without reading 
  it completely. Keyphrase extraction was first done primarily by human annotators, who read the text in detail 
  and then wrote down the most important keyphrases. The disadvantage is that if you work with a lot of documents, 
  this process can take a lot of time. 
  
  Here is where Artificial Intelligence comes in. Currently, classical machine learning methods, that use statistical 
  and linguistic features, are widely used for the extraction process. Now with deep learning, it is possible to capture 
  the semantic meaning of a text even better than these classical methods. Classical methods look at the frequency, 
  occurrence and order of words in the text, whereas these neural approaches can capture long-term semantic dependencies 
  and context of words in a text."
    example_title: "Example 1"
  - text: "FoodEx is the largest trade exhibition for food and drinks in Asia, with about 70,000 visitors checking out the products presented by hundreds of participating companies. I was lucky to enter as press; otherwise, visitors must be affiliated with the food industry— and pay ¥5,000 —  to enter. The FoodEx menu is global, including everything from cherry beer from Germany and premium Mexican tequila to top-class French and Chinese dumplings. The event was a rare chance to try out both well-known and exotic foods and even see professionals making them. In addition to booths offering traditional Japanese favorites such as udon and maguro sashimi, there were plenty of innovative twists, such as dorayaki , a sweet snack made of two pancakes and a red-bean filling, that came in coffee and tomato flavors. While I was there I was lucky to catch the World Sushi Cup Japan 2013, where top chefs from around the world were competing … and presenting a wide range of styles that you would not normally see in Japan, like the flower makizushi above."
    example_title: "Example 2"
  model-index:
  - name: DeDeckerThomas/keyphrase-extraction-distilbert-openkp
    results:
    - task: 
        type: keyphrase-extraction
        name: Keyphrase Extraction
      dataset:
        type: midas/openkp
        name: openkp
      metrics:
        - type: F1 (Seqeval) 
          value: 0.430
          name: F1 (Seqeval)
        - type: F1@M
          value: 0.314
          name: F1@M          
  ---
  # 🔑 Keyphrase Extraction Model: distilbert-openkp
  Keyphrase extraction is a technique in text analysis where you extract the important keyphrases from a document. Thanks to these keyphrases humans can understand the content of a text very quickly and easily without reading it completely. Keyphrase extraction was first done primarily by human annotators, who read the text in detail and then wrote down the most important keyphrases. The disadvantage is that if you work with a lot of documents, this process can take a lot of time ⏳. 
  
  Here is where Artificial Intelligence 🤖 comes in. Currently, classical machine learning methods, that use statistical and linguistic features, are widely used for the extraction process. Now with deep learning, it is possible to capture the semantic meaning of a text even better than these classical methods. Classical methods look at the frequency, occurrence and order of words in the text, whereas these neural approaches can capture long-term semantic dependencies and context of words in a text.
  
  
  ## 📓 Model Description
  This model uses [KBIR](https://huggingface.co/distilbert-base-uncased) as its base model and fine-tunes it on the [OpenKP dataset](https://huggingface.co/datasets/midas/openkp). 
  
  Keyphrase extraction models are transformer models fine-tuned as a token classification problem where each word in the document is classified as being part of a keyphrase or not.
  
  | Label | Description                     |
  | ----- | ------------------------------- |
  | B-KEY | At the beginning of a keyphrase |
  | I-KEY | Inside a keyphrase              |
  | O     | Outside a keyphrase             |
  
  ## ✋ Intended Uses & Limitations
  ### 🛑 Limitations
  * Limited amount of predicted keyphrases.
  * Only works for English documents.
  
  ### ❓ How To Use
  ```python
  from transformers import (
      TokenClassificationPipeline,
      AutoModelForTokenClassification,
      AutoTokenizer,
  )
  from transformers.pipelines import AggregationStrategy
  import numpy as np
  
  # Define keyphrase extraction pipeline
  class KeyphraseExtractionPipeline(TokenClassificationPipeline):
      def __init__(self, model, *args, **kwargs):
          super().__init__(
              model=AutoModelForTokenClassification.from_pretrained(model),
              tokenizer=AutoTokenizer.from_pretrained(model),
              *args,
              **kwargs
          )
  
      def postprocess(self, mode