Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
Data Juicer
Data Juicer

Tutorial

  • DJ-Cookbook
  • Installation Guide
  • Quick Start

docs

  • Operator Schemas 算子提要
  • Data Recipe Gallery
  • Dataset Configuration Guide
  • “Bad” Data Exhibition
  • DJ-SORA
  • DataJuicer-Agent
  • DJ_service
  • How-to Guide for Developers
  • Distributed Data Processing in Data-Juicer
  • Sandbox
  • Awesome Data-Model Co-Development of MLLMs

demos

  • Demos

tools

  • Distributed Fuzzy Deduplication Tools
  • Auto Evaluation Toolkit
  • GPT EVAL: Evaluate your model with OpenAI API
  • Evaluation Results Recorder
  • Format Conversion Tools
  • Multimodal Tools
  • Post Tuning Tools
  • Hyper-parameter Optimization for Data Recipe
  • Label Studio Service Utility
  • Metrics for video generation
  • VBench metrics
  • Postprocess tools
  • Preprocess Tools
  • Data Scoring

thirdparty

  • LLM Ecosystems
  • Third-party Model Library

API Reference

  • API Reference
    • data_juicer.core
    • data_juicer.ops
    • data_juicer.ops.filter
    • data_juicer.ops.mapper
    • data_juicer.ops.deduplicator
    • data_juicer.ops.selector
    • data_juicer.ops.common
    • data_juicer.analysis
    • data_juicer.config
    • data_juicer.format
en|main
Language
English 简体中文
Version
main v1.4.2 v1.4.1 v1.4.0
Back to top
View this page

data_juicer.tools.op_search module¶

Operator Searcher - A tool for filtering Data-Juicer operators by tags

class data_juicer.tools.op_search.OPRecord(op_type: str, name: str, desc: str, tags: List[str], sig: Signature, param_desc: str)[source]¶

Bases: object

A record class for storing operator metadata

__init__(op_type: str, name: str, desc: str, tags: List[str], sig: Signature, param_desc: str)[source]¶
to_dict()[source]¶
data_juicer.tools.op_search.analyze_modality_tag(code, op_prefix)[source]¶

Analyze the modality tag for the given code content string. Should be one of the “Modality Tags” in tagging_mappings.json. It makes the choice by finding the usages of attributes {modality}_key and the prefix of the OP name. If there are multiple modality keys are used, the ‘multimodal’ tag will be returned instead.

data_juicer.tools.op_search.analyze_resource_tag(code)[source]¶

Analyze the resource tag for the given code content string. Should be one of the “Resource Tags” in tagging_mappings.json. It makes the choice according to their assigning statement to attribute _accelerator.

data_juicer.tools.op_search.analyze_model_tags(code)[source]¶

Analyze the model tag for the given code content string. SHOULD be one of the “Model Tags” in tagging_mappings.json. It makes the choice by finding the model_type arg in prepare_model method invocation.

data_juicer.tools.op_search.analyze_tag_with_inheritance(op_cls, analyze_func, default_tags=[], other_parm={})[source]¶

Universal inheritance chain label analysis function

data_juicer.tools.op_search.analyze_tag_from_cls(op_cls, op_name)[source]¶

Analyze the tags for the OP from the given cls.

data_juicer.tools.op_search.extract_param_docstring(docstring)[source]¶

Extract parameter descriptions from __init__ method docstring.

class data_juicer.tools.op_search.OPSearcher(specified_op_list: List[str] | None = None)[source]¶

Bases: object

Operator search engine

__init__(specified_op_list: List[str] | None = None)[source]¶
search(tags: List[str] | None = None, op_type: str | None = None, match_all: bool = True) → List[Dict][source]¶

Search operators by criteria :param tags: List of tags to match :param op_type: Operator type (mapper/filter/etc) :param match_all: True requires matching all tags, False matches any tag :return: List of matched operator records

data_juicer.tools.op_search.main(tags, op_type)[source]¶
Copyright © 2024, Data-Juicer Team
Made with Sphinx and @pradyunsg's Furo
On this page
  • data_juicer.tools.op_search module
    • OPRecord
      • OPRecord.__init__()
      • OPRecord.to_dict()
    • analyze_modality_tag()
    • analyze_resource_tag()
    • analyze_model_tags()
    • analyze_tag_with_inheritance()
    • analyze_tag_from_cls()
    • extract_param_docstring()
    • OPSearcher
      • OPSearcher.__init__()
      • OPSearcher.search()
    • main()