Commit ·
dc4573e
1
Parent(s): d3b4e50
fina p3
Browse files12345620 unmodified lines2728293031324 unmodified lines37383940414223 unmodified lines66676869707120 unmodified lines929394959697989910037 unmodified lines138139140141142143# labeling_logic.pyLABELING_PROMPT_TEMPLATE = """You are an AI Factuality Assessment Agent operating under the "Ali Arsanjani Factuality Factors" framework.Your goal is to mass-label video content, quantifying "Veracity Vectors" and "Modality Alignment".20 unmodified lines- Strings containing commas MUST be quoted.- ALL scores must be filled (use 0 if unsure, do not leave blank).- **MODALITY SCORING:** You must provide 3 distinct alignment scores: Video-Audio, Video-Caption, and Audio-Caption.**TOON SCHEMA:**{toon_schema}4 unmodified lines<thinking>"""SCORE_INSTRUCTIONS_REASONING = """**Constraints:**1. Provide specific reasoning for EACH score in the `vectors` and `modalities` tables.23 unmodified linesfinal: assessment[1]{score,reasoning}:(Int 1-100),"Final synthesis of why this score was given""""SCHEMA_REASONING = """20 unmodified linesfinal: assessment[1]{score,reasoning}:(Int 1-100),"Final synthesis of why this score was given""""FCOT_MACRO_PROMPT = """**Fractal Chain of Thought - Stage 1: Macro-Scale Hypothesis (Wide Aperture)**You are analyzing a video for factuality.37 unmodified lines**Output Format**:Strictly fill out the following TOON schema based on the consensus. Do not include markdown code blocks.**TOON SCHEMA**:{toon_schema}123456789101112131415161718192021222324252627282930313233343536373839404120 unmodified lines626364656667684 unmodified lines73747576777879808182838485868788899091929394959697989910010110210310410510610710810911023 unmodified lines13413513613713813914014114220 unmodified lines16316416516616716816917017117217317417517637 unmodified lines214215216217218219220221# labeling_logic.pyimport osimport jsonPROMPT_VARIANTS = {"standard": {"description": "Standard Persona","instruction": "You are a Factuality Agent."},"skeptic": {"description": "Skeptical Persona","instruction": "You are a highly skeptical Factuality Agent. Assume claims might be misleading until verified."},"lenient": {"description": "Lenient Persona","instruction": "You are a lenient Factuality Agent. Assume claims are true unless overtly false."}}TEXT_ONLY_INSTRUCTIONS = """**NOTE: No video provided.** Analyze the text only (caption and transcript). Do not make assumptions about visual elements unless described in the text. Visual and Audio integrity scores should be estimated based on textual claims if applicable, or defaulted if completely unknowable."""def get_formatted_tag_list():path = "data/tags.json"if os.path.exists(path):try:with open(path, 'r') as f:tags = json.load(f)if tags:return "Suggested tags: " + ", ".join(tags.keys())except Exception:passreturn "Provide relevant comma-separated tags."LABELING_PROMPT_TEMPLATE = """{system_persona}You are an AI Factuality Assessment Agent operating under the "Ali Arsanjani Factuality Factors" framework.Your goal is to mass-label video content, quantifying "Veracity Vectors" and "Modality Alignment".20 unmodified lines- Strings containing commas MUST be quoted.- ALL scores must be filled (use 0 if unsure, do not leave blank).- **MODALITY SCORING:** You must provide 3 distinct alignment scores: Video-Audio, Video-Caption, and Audio-Caption.- **TAGS:** {tag_list_text}**TOON SCHEMA:**{toon_schema}4 unmodified lines<thinking>"""LABELING_PROMPT_TEMPLATE_NO_COT = """{system_persona}You are an AI Factuality Assessment Agent operating under the "Ali Arsanjani Factuality Factors" framework.Your goal is to mass-label video content, quantifying "Veracity Vectors" and "Modality Alignment".**INPUT DATA:**- **User Caption:** "{caption}"- **Audio Transcript:** "{transcript}"- **Visuals:** (Provided in video context)**INSTRUCTIONS:**1. **Grounding:** Cross-reference claims in the transcript with your internal knowledge base (and tools if active).2. **Output Format:** Output strictly in **TOON** format (Token-Oriented Object Notation) as defined below.**CRITICAL CONSTRAINTS:**- Do NOT repeat the input data.- **DO NOT use Markdown code blocks.** (Output plain text only).- Use strict `Key : Type [ Count ] {{ Headers }} :` format followed by data lines.- Strings containing commas MUST be quoted.- ALL scores must be filled (use 0 if unsure, do not leave blank).- **MODALITY SCORING:** You must provide 3 distinct alignment scores: Video-Audio, Video-Caption, and Audio-Caption.- **TAGS:** {tag_list_text}**TOON SCHEMA:**{toon_schema}{score_instructions}**RESPONSE:**"""SCORE_INSTRUCTIONS_REASONING = """**Constraints:**1. Provide specific reasoning for EACH score in the `vectors` and `modalities` tables.23 unmodified linesfinal: assessment[1]{score,reasoning}:(Int 1-100),"Final synthesis of why this score was given"tags: keywords[1]{tags}:"Comma-separated list of tags""""SCHEMA_REASONING = """20 unmodified linesfinal: assessment[1]{score,reasoning}:(Int 1-100),"Final synthesis of why this score was given"tags: keywords[1]{tags}:"Comma-separated list of tags""""FCOT_MACRO_PROMPT = """{system_persona}**Fractal Chain of Thought - Stage 1: Macro-Scale Hypothesis (Wide Aperture)**You are analyzing a video for factuality.37 unmodified lines**Output Format**:Strictly fill out the following TOON schema based on the consensus. Do not include markdown code blocks.**TAGS GUIDANCE**: {tag_list_text}**TOON SCHEMA**:{toon_schema}
src/labeling_logic.py+78