123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- # coding:utf-8
- def answers_writing(question: str) -> str:
- """
- 问答
- :param question: 输入文本
- :return:
- """
- input_text = f"问答:\n问题:{question}\n答案:"
- return input_text
- def dialogue(context: str, question: str) -> str:
- """
- 对话
- :param context:
- :param question:
- :return:
- """
- input_text = context + "\n用户:" + question + "\n剑鱼:"
- return input_text
- def create_context(context: str, question: str, answer: str) -> str:
- """
- 生成上下文
- :param context: 上文
- :param question: 问题
- :param answer: 回答
- :return:
- """
- context = context + "\n用户:" + question + "\n剑鱼:" + answer
- return context
- def title_words_article(title: str, words: str) -> str:
- """
- 标题、关键词生文章
- :param title:
- :param words:
- :return:
- """
- input_text = f"根据标题和关键词生成文章:\n标题:{title};关键词:{words}\n答案:"
- return input_text
- def title_article(title: str) -> str:
- """
- 标题生文章
- :param title:
- :return:
- """
- input_text = f"根据标题生成文章:\n标题:{title}\n答案:"
- return input_text
- def copy_writing(title: str, question: str) -> str:
- """
- 营销文案生成
- :param title:
- :param question:
- :return:
- """
- input_text = f"营销文案生成:\n标题:{title}\n{question}\n答案:"
- return input_text
- def info_extract(title: str, question: str) -> str:
- """
- 通用信息抽取
- :param title:
- :param question:
- :return:
- """
- input_text = f"信息抽取:\n{title}\n问题:{question}\n答案:"
- return input_text
- def extract_words(title: str) -> str:
- """
- 关键词抽取
- :param title: 文章
- :return:
- """
- input_text = f"抽取关键词:\n{title}\n关键词:"
- return input_text
- def reading(title: str, question: str) -> str:
- """
- 阅读理解
- :param title:
- :param question:
- :return:
- """
- input_text = f"阅读理解:\n段落:{title}\n问题:{question}\n答案:"
- return input_text
- def classify(title: str, question: str) -> str:
- """
- 文本分类
- :param title:
- :param question:
- :return:
- """
- input_text = f"文本分类:\n{title}\n选项:{question}\n答案:"
- return input_text
|