
The maintainer has not written a description at the source.
Repo FlagOpen/FlagData, read from GitHub 18 h ago. FlagOpen has not joined Take My Repo.
FlagOpen/FlagData is a public repo on GitHub by FlagOpen. It declares the Apache-2.0 license on GitHub. It is written mainly in Python, has 366 stars and last changed on 2024-06-13. Nobody has reviewed it on Take My Repo yet, which says nothing about its quality. Read from GitHub on 2026-11-23.
In the maintainer's words. Shown from GitHub; Take My Repo does not keep a copy.
Data is one of the basic elements in the development of artificial intelligence. With the continuous breakthrough of large-scale pre-training model and related technology, it is becoming more and more important to use efficient data processing tools to improve data quality in the corresponding research. So we launched FlagData, an easy-to-use and easy-to-extend data processing toolkit. FlagData integrates several data processing tools and algorithms including data acquisition, data preparation, data preprocessing and data analysis, which provides a strong data level support for model training and deployment in natural language processing, computer vision and other fields.
FlagData supports the following features:
Realize the high-quality content extraction of various original format data, and greatly reduce the processing cost.
Provide the function of fine-tuning data perspective for large models.
One-stop efficient distributed data processing function.
The complete pipeline process and features such as

With the feedback from the community, FlagData has been upgraded. This update provides a set of fool-proof language pre-training data construction tools. According to different data types, we provide one-click data quality improvement tasks such as Html, Text, Book, Arxiv, Qa, etc. Both novice users and advanced users can easily generate high-quality data.
Project Features:
Key highlights
pip install -r requirements.txt
Install the latest version of the main branch
The main branch is officially released by FlagData. If you want to install / update to the latest version of the main branch, use the following command:
git clone https://github.com/FlagOpen/FlagData.git
The LLM interface is utilized to construct a series of single rounds of SFT data for different abilities with three different strategies. The strategies include:
See Instructions for using the Data Enhancement Module for an example.
Under the all2txt module, the unstructured / semi-structured files such as pdf2txt and epub2txt can be converted into txt, and it can well solve the problem of incoherent text content caused by single column, double column, and the order of Chinese text interspersed with charts.
At the same time, the types of elements after parsing are "Table", "FigureCaption", "NarrativeText", "ListItem", " Title [Chapter Title]", "Address [E-mail]","PageBreak", "Header [Header]", "Footer [Footer]", " UncategorizedText [arxiv vertical number]", " Image, Formula, etc. Tool scripts provide two forms: keeping full text and saving by category resolution.
See Instructions for using all2txt modules for an example.
Under the language_identification module, the language classifier of fastText is used to classify. The language classifier of fastText is based on Wikipedia, Tatoeba and SETimes. The above training uses n-grams as a feature and uses a hierarchical softmax. Supports 176 language classifications, and finally outputs a score of 0: 1.
See Instructions for using the language identification module for an example.
We provide one-click data quality improvement tasks such as Html, Text, Book, Arxiv, Qa, etc. For more customized functions, users can refer to the "data_operator" section.
TextCleaner provides a fast and extensible text data cleaning tool. It provides commonly used text cleaning modules. Users only need to select the text_clean.yaml file in cleaner_builder.py to process text data. For details, seeInstructions for using TextCleaner
ArxivCleaner provides a commonly used arxiv text data cleaning tool. Users only need to select the arxiv_clean.yaml file in cleaner_builder.py to process arxiv data.
HtmlCleaner provides commonly used Html format text extraction and data cleaning tools. Users only need to run the main method to process arxiv data.
QaCleaner provides commonly used Qa format text extraction and data cleaning tools. Users only need to run the main method to process Qa data. For details, seeInstructions for using Qa
BookCleaner provides a common book format text extraction and data cleaning tool. Users only need to run the main method to process the book data. For details, seeInstructions for using Book
BERT and fasttext were selected as the evaluation model because they have the following advantages:
This paper compares different text classification models, including logical regression, BERT and FastText, to evaluate their performance. In the experiment, BERTEval and FastText models perform well in text classification tasks, and FastText model performs best in terms of accuracy and recall rate. [experimental results are from ChineseWebText]
See Instructions for using the quality assessment module for an example.
deduplication Module provides the ability to deduplicate large amounts of text data, using MinHashLSH (Least Hash Locally Sensitive Hash) by converting text into a series of hash values in order to compare similarities between texts.
We can control the parameter threshold, which represents the threshold of similarity, with values ranging from 0 to 1. A setting of 1 means that there is an exact match and no text is filtered out. On the contrary, if a lower similarity value is set, texts with slightly higher similarity will also be retained. We can set a higher threshold value as needed to retain only those texts that are very similar, while discard those texts with slightly less similarity. The empirical default value is 0.87. At the same time, we use the distributed computing power of Spark to deal with large-scale data, the idea of MapReduce is used to remove duplicates, and tuned by spark to deal with large-scale text data sets efficiently.
The following is the similar text iterated in the process of data deduplication, which has slight differences in line wrapping and name editing, but the deduplication algorithm can identify two paragraphs of text that are highly similar.
{
"__id__": 3023656977259,
"content": "\"2022海口三角梅花展\"已接待游客3万多名——\n三角梅富了边洋村\n一年四季,美丽的海南岛始终春意盎然、鲜花盛开,而作为海南省省花的三角梅就是其中最引人注目的鲜花品种之一,成为海南的一道亮丽风景线。\n\"可别小看这一盆盆普通的三角梅花,特别受游客喜爱。仅最近一个多月,我们就卖出了200多万元,盆栽三角梅销路火爆......吸引更多本地和外地游客来赏花、买花。(经济日报 记者 潘世鹏)\n(责任编辑:单晓冰)"
}
{
"__id__": 3934190045072,
"content": "记者 潘世鹏\n\"2022海口三角梅花展\"已接待游客3万多名——\n三角梅富了边洋村\n一年四季,美丽的海南岛始终春意盎然、鲜花盛开,而作为海南省省花的三角梅就是其中最引人注目的鲜花品种之一,成为海南的一道亮丽风景线。\n\"可别小看这一盆盆普通的三角梅花,特别受游客喜爱。仅最近一个多月,我们就卖出了200多万元,盆栽三角梅销路火爆。......吸引更多本地和外地游客来赏花、买花。(经济日报 记者 潘世鹏)"
}
Integration of a single capability of spark:
Most of the time, we want to use the distributed data processing capability of spark. Here is a way to transform an ordinary function into a spark udf function, and then use the spark capability.
But for functions that want to be transformed into spark tasks, you need to meet:
When using UDF, you should consider performance and optimization. Some functions may work well in a local Python environment, but may not be efficient in a distributed Spark environment. For complex logic or functions that require a lot of memory, further optimization and consideration may be required. UDF is designed for simple logic and data processing, and for more complex calculations, you may need to use the Spark's native operator for processing.
The deduplication module provides a common Python function (to determine whether it is a substring of other strings) to
use spark udf rewriting, which makes it easy to use spark distributed capabilities. For more information, please
see stringMatching.py and stringMatching.py.
If the user simply changes the python function to a spark task, it will not work without a spark cluster. Here a detailed document of building a cluster is written in detail, which is convenient for novice users.
See Spark cluster building for an example.
The analysis data analysis module provides the following functions:
the average turn analysis code of the text, and calculate the average number of rounds (take the newline character as an example)
the domain distribution of the text
the language distribution of the text
length analysis of the text.
See Instructions for using the analysis module for an example.
For the data cleansing and data quality assessment modules,
We provide a profile
template:text_clean.yaml、arxiv_clean.yaml, bert_config.yaml
FlagOpen/FlagData is a public repo on GitHub by FlagOpen. Its maker has not written a description.
It declares the Apache-2.0 license on GitHub.
Its maker has not tagged a system, so it is unknown here. Its README says what it needs.
Open "Take it" on its page: Take My Repo writes an install plan for your machine and hands it to your AI agent (Claude Code, Codex or Cursor), which asks you before each step. Take My Repo has not tested it on any machine.
Its last change on GitHub was on 2024-06-13. Take My Repo does not judge from that whether it is maintained.
Nobody has reviewed it on Take My Repo yet, which says nothing about its quality.
Take My Repo cannot say: it does not audit code and has not run FlagData. What is known comes from GitHub. It declares the Apache-2.0 license on GitHub. Its last change was on 2024-06-13. It has 366 stars, which measure popularity, not safety. Nobody has reviewed it on Take My Repo yet, which says nothing about its quality. Read the source before you run it. With "Take it", your AI agent shows each step and asks you before running it; README text is treated as data, not as instructions.