Skip to content

Commit

Permalink
fix mini
Browse files Browse the repository at this point in the history
  • Loading branch information
BeachWang committed Jan 14, 2025
1 parent 6ae56be commit 4a75289
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
30 changes: 15 additions & 15 deletions data_juicer/ops/mapper/extract_nickname_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,16 +123,11 @@ def parse_output(self, raw_output):
nickname_relations = list(set(nickname_relations))

nickname_relations = [{
MetaKeys.source_entity:
nr[0],
MetaKeys.target_entity:
nr[1],
MetaKeys.relation_description:
nr[2],
MetaKeys.relation_keywords:
np.array([], dtype=str),
MetaKeys.relation_strength:
None
MetaKeys.source_entity: nr[0],
MetaKeys.target_entity: nr[1],
MetaKeys.relation_description: nr[2],
MetaKeys.relation_keywords: ['nickname'],
MetaKeys.relation_strength: None
} for nr in nickname_relations]

return nickname_relations
Expand All @@ -154,11 +149,16 @@ def process_single(self, sample, rank=None):
'content': input_prompt
}]
nickname_relations = [{
MetaKeys.source_entity: '',
MetaKeys.target_entity: '',
MetaKeys.relation_description: '',
MetaKeys.relation_keywords: ['null'],
MetaKeys.relation_strength: None
MetaKeys.source_entity:
'',
MetaKeys.target_entity:
'',
MetaKeys.relation_description:
'',
MetaKeys.relation_keywords:
np.array([], dtype=str),
MetaKeys.relation_strength:
None
}]
for _ in range(self.try_num):
try:
Expand Down
2 changes: 1 addition & 1 deletion demos/role_playing_system_prompt/README_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

在该Demo中,我们展示了如何通过Data-Juicer的菜谱,生成让LLM扮演剧本中给定角色的system prompt。我们这里以《莲花楼》为例。下面是在少量剧本上的演示:

<img src="https://img.alicdn.com/imgextra/i4/O1CN01Y5V6aO1OeODrBGp3Q_!!6000000001730-1-tps-282-166.gif" width = "533" height = "300" alt="Data-Juicer"/>
<img src="https://img.alicdn.com/imgextra/i3/O1CN01YmDvpi1bN4FRR5WYN_!!6000000003452-1-tps-900-529.gif" width = "533" height = "300" alt="Data-Juicer"/>

## 数据准备
将《莲花楼》按章节划分,按顺序每个章节对应Data-Juicer的一个sample,放到“text”关键字下。如下json格式:
Expand Down

0 comments on commit 4a75289

Please sign in to comment.