Coverage for intelligence_toolkit/match_entity_records/prompts.py: 100%

4 statements  

« prev     ^ index     » next       coverage.py v7.10.7, created at 2025-10-16 13:41 -0300

1# Copyright (c) Microsoft. All rights reserved. 

2# Licensed under the MIT license. See LICENSE file in the project. 

3# 

4 

5from intelligence_toolkit.AI.metaprompts import ( 

6 do_not_disrespect_context, 

7 do_not_harm, 

8) 

9report_prompt = """\ 

10Goal: evaluate the overall RELATEDNESS of the records in each record group provided on a scale of 0-10, where 0 is definitively different entities and 10 is definitivly the same entity or entity group (e.g., branches of a company). 

11 

12Output the rows of a CSV file containing the Group ID, Relatedness, and Explanation. 

13 

14Do not output ``` or the column headers - start directly with the row values and separate each row with a newline. Output Group ID and Relatedness directly, but wrap explanations in "". 

15 

16=== TASK === 

17 

18Group data: 

19 

20{data} 

21""" 

22 

23user_prompt = """\ 

24Factors indicating unrelatedness: multiple fields having values that are different across grouped records, have no similarity, and are unrelated in the real-world. 

25 

26Factors indicating relatedness: multiple fields having values that are the same or similar across multiple grouped records, and are related in the real-world. 

27 

28Factors that should be ignored: inconsistent spelling, formatting, and missing values. 

29 

30Factors that should be considered in the event of similar names: the more additional fields that are the same, the more likely the records are related. 

31 

32If names are in a language other than English, consider whether the English translations are generic descriptive terms (less likely to be related) or distinctive (more likely to be related). 

33 

34Keep explanations short and simple. 

35 

36""" 

37 

38 

39list_prompts = { 

40 "report_prompt": report_prompt, 

41 "user_prompt": user_prompt, 

42 "safety_prompt": f"{do_not_harm} {do_not_disrespect_context}", 

43}