File size: 4,798 Bytes
7b0ac7e
59d0dee
7b0ac7e
59d0dee
 
 
 
 
 
 
 
 
 
 
 
 
7b0ac7e
59d0dee
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
---
language: fr
license: gpl-3.0
tags:
- keyword-extraction
- french-nlp
- prompt-engineering
- information-retrieval
- generative-ai
pretty_name: French Keyword Extraction Trio (Prompt / Sentences / Searching)
task_categories:
- text-generation
- text-retrieval
- token-classification
source_datasets:
- original
---

# French Keyword Extraction

## Dataset Description

This dataset is a collection of **French phrase–keyword pairs** designed for training and evaluating keyword extraction models, prompt engineering, or query expansion systems. It is composed of three distinct subsets (configurations), each reflecting a specific linguistic register and use case.

All inputs are in **French** and contain between 1 and 5 sentences, offering varied contextual lengths. The dataset was generate with `Claude Sonnet 5` (`High` / `Medium`).

### Supported Configurations

| Config Name | Description | Input Length | Keyword Separator |
| :--- | :--- | :--- | :--- |
| `prompt` | Prompts addressed to AI assistants (interrogative/imperative forms). | 1 to 5 sentences | `", "` (comma + space) |
| `sentences` | Affirmative or declarative statements, not necessarily questions. | 1 to 5 sentences | `", "` (comma + space) |
| `searching` | Internet search queries, often containing significant background context. | 1 to 4 sentences (dense context) | `" "` (simple space) |

---

## Dataset Structure

### Data Fields

All configurations share the same two-column CSV structure:

- **`Input`** (`string`): The original French text (prompt, sentence, or search query).
- **`Output`** (`string`): The list of extracted keywords.

> **Important**: Pay attention to the keyword separator for each config:
> - `prompt` & `sentences` → keywords are separated by a **comma and a space** (e.g., `"intelligence artificielle, éthique, régulation"`).
> - `searching` → keywords are separated by a **simple space** (e.g., `"meilleur restaurant paris 2024"`).

### Data Splits

Currently, this dataset is provided as a **single split** (`train`) per configuration. If you wish to create train/validation splits, we recommend doing so locally using `datasets` or `sklearn.model_selection`.

---

## Usage Example (Python)

Load a specific configuration using the 🤗 `datasets` library:

```python
from datasets import load_dataset

# Load the "prompt" subset
dataset_prompt = load_dataset("LugolBis/KeywordsExtraction", "prompt", split="train")

# Load the "sentences" subset
dataset_sentences = load_dataset("LugolBis/KeywordsExtraction", "sentences", split="train")

# Load the "searching" subset
dataset_searching = load_dataset("LugolBis/KeywordsExtraction", "searching", split="train")

# Explore an example
print(dataset_prompt[0])
# Output example:
# {'Input': 'Quels sont les impacts du réchauffement climatique sur la biodiversité marine ?', 
#  'Output': 'réchauffement climatique, biodiversité marine, impacts'}
```

---

## Dataset Creation

### Curation Rationale

The dataset was built to cover three distinct modalities of natural language queries:
1. **Prompts**: Capturing the instructional/inquisitive tone used when interacting with Large Language Models.
2. **Sentences**: Covering descriptive and factual statements to extract core concepts.
3. **Searching**: Mimicking real-world search engine behaviors where context is key, and keywords often act as boolean/concatenated phrases (hence the space separator).

### Source Data

All the `Input` sentences (prompts, qearch queries, etc.) were generated with an _LLM_ : `Claude Sonnet 5` (`High` / `Medium`).

### Annotations

All the `Output` keywords extracted from the sentences were generated with an _LLM_ : `Claude Sonnet 5` (`High` / `Medium`).

---

## Considerations for Using the Data

### Social Impact & Limitations

- The dataset is exclusively in **French**, making it suitable for Francophone NLP applications but limited for multilingual models.
- The keyword extraction logic might carry inherent biases depending on the annotator or the LLM used for generation.
- The `searching` subset uses space-separated keywords, which might represent query expansion tokens rather than strict semantic concepts.

### Recommended Use Cases

- Fine-tuning small/medium LLMs for **French keyword generation**.
- Training **embedding models** for document retrieval.
- Evaluating **prompt engineering** techniques for summarization.
- Building **query suggestion** systems for search engines.

## Citation

If you use this dataset in your research, please cite it as follows :

```bibtex
@misc{your_name_2024_french_keywords,
  author = {LugolBis},
  title = {French Keyword Extraction},
  year = {2024},
  publisher = {Hugging Face},
  howpublished = {\url{https://huggingface.co/datasets/LugolBis/KeywordsExtraction}}
}
```