ModelScope的这个链接你们能打开么?https://developer.aliyun.com/article/1027733?spm=a2c6h.14164896.0.0.1c1d3483goazti#slide-5
from dataclasses import dataclass
from typing import List
import pandas as pd
import json
@dataclass
class FAQ:
title: str
sim_questions: List[str]
answer: str
faq_id: int
ori_data = pd.read_csv('baoxianzhidao_filter.csv')
data = []
exist_titles = set()
for index, row in enumerate(ori_data.iterrows()):
row_dict = row[1]
title = row_dict['title']
if title not in exist_titles:
data.append(FAQ(title=title, answer=row_dict['reply'], sim_questions=[title], faq_id=index))
exist_titles.add(title)