KR102642981B1 - Method for providing chat-bot service and user terminal therefor - Google Patents

Method for providing chat-bot service and user terminal therefor Download PDF

Info

Publication number
KR102642981B1
KR102642981B1 KR1020230178571A KR20230178571A KR102642981B1 KR 102642981 B1 KR102642981 B1 KR 102642981B1 KR 1020230178571 A KR1020230178571 A KR 1020230178571A KR 20230178571 A KR20230178571 A KR 20230178571A KR 102642981 B1 KR102642981 B1 KR 102642981B1
Authority
KR
South Korea
Prior art keywords
user
query
information
language model
conversation
Prior art date
Application number
KR1020230178571A
Other languages
Korean (ko)
Inventor
김익
Original Assignee
주식회사 미니레코드
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 주식회사 미니레코드 filed Critical 주식회사 미니레코드
Priority to KR1020230178571A priority Critical patent/KR102642981B1/en
Application granted granted Critical
Publication of KR102642981B1 publication Critical patent/KR102642981B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation or dialogue systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/3332Query translation
    • G06F16/3334Selection or weighting of terms from queries, including natural language queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3347Query execution using vector based model
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/338Presentation of query results
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/951Indexing; Web crawling techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9535Search customisation based on user profiles and personalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06Q50/50
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/02User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail using automatic reactions or user delegation, e.g. automatic replies or chatbot-generated messages

Abstract

챗봇 서비스를 제공하는 방법 및 이를 위한 사용자 단말이 개시된다. 본 개시에 따른 사용자 단말은 사용자로부터 특정 대화 상대에 대한 제1 쿼리를 획득하고, 사용자, 대화 상대 또는 대화 상대와 사용자 사이의 대화 내용과 관련된 특성 정보를 로드하고, 특성 정보에 대응하는 시스템 프롬프트를 생성하고, 제1 쿼리에 대응하는 사용자 프롬프트 및 시스템 프롬프트를 제1 언어 모델에 입력하고, 제1 언어 모델의 출력을 제1 쿼리에 대한 대화 상대의 응답으로 제공할 수 있다.A method of providing a chatbot service and a user terminal for the same are disclosed. The user terminal according to the present disclosure obtains a first query about a specific conversation partner from the user, loads characteristic information related to the user, the conversation partner, or the content of the conversation between the conversation partner and the user, and issues a system prompt corresponding to the characteristic information. A user prompt and a system prompt corresponding to the first query may be generated and input into the first language model, and the output of the first language model may be provided as the conversation partner's response to the first query.

Description

챗봇 서비스를 제공하는 방법 및 이를 위한 사용자 단말{METHOD FOR PROVIDING CHAT-BOT SERVICE AND USER TERMINAL THEREFOR}Method of providing chatbot service and user terminal for the same {METHOD FOR PROVIDING CHAT-BOT SERVICE AND USER TERMINAL THEREFOR}

본 개시는 인물의 페르소나(Persona)를 반영한 챗봇 서비스를 제공하는 방법 및 이를 위한 사용자 단말에 관한 것이다.This disclosure relates to a method of providing a chatbot service reflecting a person's persona and a user terminal for the same.

컴퓨팅 기기의 연산 처리 능력과 인공지능 기술의 발달에 힘입어, 인간의 대화를 시뮬레이션하고 처리하는 챗봇(Chat- Bot) 서비스가 등장하였다. 대화를 나누고 궁금증을 해결하거나, 서로 이해와 공감을 나눌 사람이 부족한 현대인에게 언제든지 소통할 수 있는 대상이 있다는 것은 매우 매력적이어서, 챗봇 서비스는 상품이나 재화에 대한 문의를 처리하는 상담 서비스에서부터 가상 인물과의 유대감을 형성할 수 있는 열린 주제의 대화형 인공지능 서비스에 이르기까지 다방면으로 활용되고 있다.Thanks to the computational processing power of computing devices and the development of artificial intelligence technology, chatbot services that simulate and process human conversations have emerged. For modern people who lack people to talk to, solve their questions, or share mutual understanding and empathy with, having someone they can communicate with at any time is very attractive, so chatbot services range from consulting services that handle inquiries about products or goods to virtual characters and It is being used in a variety of ways, from interactive artificial intelligence services with open topics that can form bonds.

특히 대화형 인공지능 서비스는 다수의 사용자들과 범용적인 주제로 소통할 수 있기 때문에, 24시간 깨어있는 친구로서의 역할이 가능하다는 점에서 매우 유망한 챗봇 서비스라 할 수 있다. 더 나아가, 대화형 인공지능 서비스를 통해 특정 연예인이나 캐릭터와 대화하는 듯한 경험을 제공할 수 있다면, 그 수요는 폭발적으로 성장할 수 있을 것이다.In particular, the conversational artificial intelligence service can be said to be a very promising chatbot service in that it can communicate with a large number of users on general topics and can serve as a friend who is awake 24 hours a day. Furthermore, if conversational artificial intelligence services can provide an experience that feels like talking to a specific celebrity or character, demand could grow explosively.

다만 대화형 인공지능 서비스를 위해서는 범용 인공지능이 필요한 만큼, 사용자의 입력에 내포된 컨텍스트(Context)를 잘 파악하고 다양한 수준의 응답을 생성하는 능력이 요구된다. 특히, 특정 연예인이나 캐릭터와 대화하는 듯한 경험을 제공하기 위해서는 인공지능에 그 연예인이나 캐릭터의 페르소나(Persona)를 비롯한 여러 특성을 충실히 반영할 필요가 있다.However, since general-purpose artificial intelligence is required for interactive artificial intelligence services, the ability to understand the context contained in the user's input and generate various levels of responses is required. In particular, in order to provide an experience that feels like talking to a specific celebrity or character, it is necessary to faithfully reflect the persona and other characteristics of that celebrity or character in artificial intelligence.

본 개시는 인공지능에 특정 연예인이나 캐릭터의 여러 특성을 충실히 반영할 수 있도록, 사용자가 특정한 대화 상대의 특성을 이용하여 대화 형식을 따르는 프롬프트를 설계하기 위한 것이다.The purpose of this disclosure is to design a prompt that allows the user to follow a conversation format using the characteristics of a specific conversation partner so that various characteristics of a specific celebrity or character can be faithfully reflected in artificial intelligence.

본 개시에서 이루고자 하는 기술적 과제는 상기된 바와 같은 기술적 과제들로 한정되지 않으며, 이하의 실시예들로부터 또 다른 기술적 과제들이 유추될 수 있다.The technical problems to be achieved in the present disclosure are not limited to the technical problems described above, and other technical problems can be inferred from the following embodiments.

본 개시의 일 측면에 따르면, 사용자 단말에서 수행되는 챗봇 서비스 제공 방법은, 사용자로부터 특정 대화 상대에 대한 제1 쿼리를 획득하는 단계; 상기 사용자, 상기 대화 상대 또는 상기 대화 상대와 상기 사용자 사이의 대화 내용과 관련된 특성 정보를 로드하는 단계; 상기 특성 정보에 대응하는 시스템 프롬프트를 생성하는 단계; 상기 제1 쿼리에 대응하는 사용자 프롬프트 및 상기 시스템 프롬프트를 제1 언어 모델에 입력하는 단계; 및 상기 제1 언어 모델의 출력을 상기 제1 쿼리에 대한 상기 대화 상대의 응답으로 제공하는 단계를 포함할 수 있다.According to one aspect of the present disclosure, a method of providing a chatbot service performed on a user terminal includes obtaining a first query about a specific conversation partner from the user; loading characteristic information related to the user, the conversation partner, or content of a conversation between the conversation partner and the user; generating a system prompt corresponding to the characteristic information; inputting a user prompt and a system prompt corresponding to the first query into a first language model; and providing the output of the first language model as the conversation partner's response to the first query.

일 실시 예에 따르면, 상기 특성 정보는, 상기 사용자와 관련된 제1 특성 정보를 포함하고, 상기 제1 특성 정보는, 상기 사용자의 챗봇 서비스 회원가입 시 수집된 정보를 포함할 수 있다.According to one embodiment, the characteristic information includes first characteristic information related to the user, and the first characteristic information may include information collected when the user signs up for membership in a chatbot service.

다른 실시 예에 따르면, 상기 특성 정보는, 상기 대화 상대와 관련된 제2 특성 정보를 포함하고, 상기 제2 특성 정보는, 상기 대화 상대의 대화 스타일 데이터를 포함하는 페르소나 정보 및 상기 대화 상대의 사실 관계 정보를 포함할 수도 있다. 이와 관련하여, 상기 사실 관계 정보는, 상기 대화 상대의 사실 관계에 대응하는 복수의 임베딩 벡터 중 상기 제1 쿼리와의 유사도가 임계 값 이상인 임베딩 벡터를 포함할 수도 있다.According to another embodiment, the characteristic information includes second characteristic information related to the conversation partner, and the second characteristic information includes persona information including conversation style data of the conversation partner and factual relationship of the conversation partner. It may also contain information. In this regard, the factual relationship information may include an embedding vector whose similarity with the first query is greater than or equal to a threshold value among a plurality of embedding vectors corresponding to the factual relationship of the conversation partner.

또 다른 실시 예에 따르면, 상기 특성 정보는, 상기 대화 상대와 관련된 제2 특성 정보를 포함하고, 상기 제2 특성 정보는, 웹 크롤링(Web Crawling)을 통해 수집되거나, 기 설정된 협약 조건에 따라 상기 대화 상대의 매니지먼트 서버로부터 전송되는 것일 수 있다.According to another embodiment, the characteristic information includes second characteristic information related to the conversation partner, and the second characteristic information is collected through web crawling or according to preset agreement conditions. It may be transmitted from the management server of the person you are talking to.

또 다른 실시 예에 따르면, 상기 특성 정보는, 상기 대화 내용과 관련된 제3 특성 정보를 포함하고, 상기 제3 특성 정보는, 상기 대화 내용 중 상기 사용자 단말의 내장 메모리에 추출되어 저장된 중장기 기억 정보 및 상기 대화 내용 중 상기 사용자 단말의 랜덤 액세스 메모리(Random Access Memory, RAM)에 저장된 단기 기억 정보를 포함할 수 있다. 관련하여, 상기 중장기 기억 정보는, JavaScript Object Notation(JSON) 파일 형식으로 저장되는 제1 중장기 기억 정보 및 임베딩 벡터로 변환되어 바이너리(BIN) 파일 형식으로 저장되는 제2 중장기 기억 정보를 포함할 수도 있다.According to another embodiment, the characteristic information includes third characteristic information related to the conversation content, and the third characteristic information includes mid- to long-term memory information extracted and stored in the internal memory of the user terminal from the conversation content, and The conversation content may include short-term memory information stored in the random access memory (RAM) of the user terminal. In relation to this, the mid- to long-term memory information may include first mid- to long-term memory information stored in a JavaScript Object Notation (JSON) file format and second mid- to long-term memory information converted to an embedding vector and stored in a binary (BIN) file format. .

또 다른 실시 예에 따르면, 상기 특성 정보는, 상기 대화 내용과 관련된 제3 특성 정보를 포함하고, 상기 제3 특성 정보는, 상기 대화 내용 중 상기 사용자의 입력의 적어도 일부가 추출되어 저장된 중장기 기억 정보 및 상기 대화 내용 중 최근 N개(단, N은 자연수)의 대화 내용이 저장된 단기 기억 정보를 포함할 수도 있다.According to another embodiment, the characteristic information includes third characteristic information related to the conversation content, and the third characteristic information is mid- to long-term memory information in which at least a portion of the user's input from the conversation content is extracted and stored. And it may include short-term memory information in which the most recent N conversations (where N is a natural number) among the conversation contents are stored.

한편 일 실시 예에 따르면, 상기 시스템 프롬프트를 생성하는 단계는, 상기 특성 정보를 구성하는 요소 각각을 기 정의된 시스템 프롬프트 템플릿의 인자로 입력하는 단계; 및 상기 시스템 프롬프트 템플릿의 출력 값에 순차(concatenation) 함수를 적용하여 상기 시스템 프롬프트를 생성하는 단계를 포함할 수 있다.Meanwhile, according to one embodiment, the step of generating the system prompt includes inputting each element constituting the characteristic information as an argument of a predefined system prompt template; and generating the system prompt by applying a concatenation function to the output value of the system prompt template.

한편 일 실시 예에 따르면, 상기 제공하는 단계는, 상기 제1 언어 모델의 출력에 상기 제1 언어 모델에의 입력을 위해 정의된 프롬프트 정보 중 적어도 일부가 포함된 경우, 상기 제1 언어 모델의 출력에 포함된 프롬프트 정보를 필터링하는 단계를 포함할 수 있다.Meanwhile, according to one embodiment, the providing step includes, when the output of the first language model includes at least some of the prompt information defined for input to the first language model, the output of the first language model It may include filtering the prompt information included in .

한편 일 실시 예에 따르면, 상기 챗봇 서비스 제공 방법은, 상기 제1 언어 모델의 출력을 상기 사용자 단말의 랜덤 액세스 메모리에 저장하는 단계를 더 포함할 수 있다.Meanwhile, according to one embodiment, the chatbot service providing method may further include storing the output of the first language model in the random access memory of the user terminal.

한편 다른 실시 예에 따르면, 상기 챗봇 서비스 제공 방법은, 상기 사용자 단말의 내장 메모리에 저장될 중장기 기억 정보를 추출하기 위한 제2 언어 모델에 상기 제1 쿼리를 입력하는 단계; 및 상기 제2 언어 모델이 상기 제1 쿼리에서 중장기 기억 정보를 추출하는 경우, 상기 추출된 중장기 기억 정보를 상기 내장 메모리에 저장하는 단계를 더 포함할 수도 있다.Meanwhile, according to another embodiment, the chatbot service providing method includes inputting the first query into a second language model for extracting mid- to long-term memory information to be stored in the internal memory of the user terminal; And when the second language model extracts mid- to long-term memory information from the first query, it may further include storing the extracted mid- to long-term memory information in the internal memory.

한편 또 다른 실시 예에 따르면, 상기 챗봇 서비스 제공 방법은, 상기 사용자로부터 상기 사용자 단말의 내장 메모리에 저장된 중장기 기억 정보 중 적어도 일부에 대한 삭제 요청을 수신하는 단계; 및 상기 삭제 요청에 해당하는 상기 중장기 기억 정보를 상기 내장 메모리에서 삭제하는 단계를 더 포함할 수도 있다.Meanwhile, according to another embodiment, the chatbot service providing method includes: receiving a request for deletion of at least a portion of mid- to long-term memory information stored in the internal memory of the user terminal from the user; And it may further include deleting the mid- to long-term storage information corresponding to the deletion request from the internal memory.

한편 또 다른 실시 예에 따르면, 상기 챗봇 서비스 제공 방법은, 상기 제1 언어 모델의 출력을 상기 대화 상대의 응답으로 제공함에 따라, 상기 사용자의 과금 상태에 대응하는 챗봇 서비스 이용 가능 횟수를 갱신하는 단계를 더 포함할 수도 있다.Meanwhile, according to another embodiment, the chatbot service providing method includes providing the output of the first language model as a response from the conversation partner, and updating the number of chatbot service availability corresponding to the user's billing status. It may also include more.

본 개시의 다른 측면에 따르면, 사용자 단말에서 수행되는 챗봇 서비스 제공 방법은, 사용자로부터 특정 대화 상대에 대한 제1 쿼리를 획득하는 단계; 상기 사용자의 과금 상태에 기반하여, 현재 상기 사용자의 챗봇 서비스 이용이 가능한지 판단하는 단계에 더하여, 상기 사용자의 챗봇 서비스 이용이 불가한 경우, 상기 제1 쿼리에 대한 응답을 출력할 수 없음을 안내하는 메시지를 제공하는 단계를 포함하고, 상기 사용자의 챗봇 서비스 이용이 가능한 경우: 상기 사용자, 상기 대화 상대 또는 상기 대화 상대와 상기 사용자 사이의 대화 내용과 관련된 특성 정보를 로드하는 단계; 상기 특성 정보에 대응하는 시스템 프롬프트를 생성하는 단계; 상기 제1 쿼리에 대응하는 사용자 프롬프트 및 상기 시스템 프롬프트를 제1 언어 모델에 입력하는 단계; 및 상기 제1 언어 모델의 출력을 상기 제1 쿼리에 대한 상기 대화 상대의 응답으로 제공하는 단계를 포함할 수 있다.According to another aspect of the present disclosure, a method of providing a chatbot service performed on a user terminal includes obtaining a first query about a specific conversation partner from the user; In addition to determining whether the user can currently use the chatbot service based on the user's billing status, if the user cannot use the chatbot service, informing that a response to the first query cannot be output. Providing a message, and when the user can use the chatbot service: loading characteristic information related to the user, the conversation partner, or the contents of a conversation between the conversation partner and the user; generating a system prompt corresponding to the characteristic information; inputting a user prompt and a system prompt corresponding to the first query into a first language model; and providing the output of the first language model as the conversation partner's response to the first query.

본 개시의 또 다른 측면에 따르면, 사용자 단말에서 수행되는 챗봇 서비스 제공 방법은, 사용자로부터 특정 대화 상대에 대한 제1 쿼리를 획득하는 단계; 상기 제1 쿼리의 내용에 기반하여 상기 제1 쿼리의 입력 가부를 판단하는 단계에 더하여, 상기 제1 쿼리가 입력 불가한 것으로 판단되는 경우, 상기 제1 쿼리에 대한 응답을 출력할 수 없음을 안내하는 메시지를 제공하는 단계를 포함하고, 상기 제1 쿼리가 입력 가능한 것으로 판단되는 경우: 상기 사용자, 상기 대화 상대 또는 상기 대화 상대와 상기 사용자의 대화 내용과 관련된 특성 정보를 로드하는 단계; 상기 특성 정보에 대응하는 시스템 프롬프트를 생성하는 단계; 상기 제1 쿼리에 대응하는 사용자 프롬프트 및 상기 시스템 프롬프트를 제1 언어 모델에 입력하는 단계; 및 상기 제1 언어 모델의 출력을 상기 제1 쿼리에 대한 상기 대화 상대의 응답으로 제공하는 단계를 포함할 수 있다.According to another aspect of the present disclosure, a method of providing a chatbot service performed on a user terminal includes obtaining a first query about a specific conversation partner from the user; In addition to the step of determining whether or not to input the first query based on the contents of the first query, if the first query is determined to be impossible to input, inform that a response to the first query cannot be output. providing a message that says, and when it is determined that the first query is inputable: loading characteristic information related to the user, the conversation partner, or content of a conversation between the conversation partner and the user; generating a system prompt corresponding to the characteristic information; inputting a user prompt and a system prompt corresponding to the first query into a first language model; and providing the output of the first language model as the conversation partner's response to the first query.

일 실시 예에 따르면, 상기 제1 쿼리의 입력 가부를 판단하는 단계는, 기 정의된 금칙어 데이터셋을 참조하여, 상기 제1 쿼리에 상기 금칙어 데이터셋에 포함된 금칙어가 포함된 경우 상기 제1 쿼리를 입력 불가한 것으로 판단하는 단계를 포함할 수 있다.According to one embodiment, the step of determining whether to input the first query refers to a predefined prohibited word dataset, and when the first query includes a prohibited word included in the prohibited word dataset, the first query It may include a step of determining that input is not possible.

다른 실시 예에 따르면, 상기 제1 쿼리의 입력 가부를 판단하는 단계는, 기 정의된 민감 데이터셋을 참조하여, 상기 제1 쿼리에 대응되는 주제가 상기 민감 데이터셋에 포함된 주제에 해당하는 경우 상기 제1 쿼리를 입력 불가한 것으로 판단하는 단계를 포함할 수 있다.According to another embodiment, the step of determining whether or not to input the first query refers to a predefined sensitive data set, and, if the topic corresponding to the first query corresponds to a topic included in the sensitive data set, It may include determining that the first query cannot be entered.

본 개시의 또 다른 측면에 따라 챗봇 서비스를 제공하는 사용자 단말은, 하나 이상의 프로세서; 및 상기 하나 이상의 프로세서에 의해 실행되는 하나 이상의 명령을 저장하는 메모리를 포함하고, 상기 하나 이상의 프로세서는, 상기 하나 이상의 명령을 실행함으로써, 사용자로부터 특정 대화 상대에 대한 제1 쿼리를 획득하고, 상기 사용자, 상기 대화 상대 또는 상기 대화 상대와 상기 사용자 사이의 대화 내용과 관련된 특성 정보를 로드하고, 상기 특성 정보에 대응하는 시스템 프롬프트를 생성하고, 상기 제1 쿼리에 대응하는 사용자 프롬프트 및 상기 시스템 프롬프트를 제1 언어 모델에 입력하고, 상기 제1 언어 모델의 출력을 상기 제1 쿼리에 대한 상기 대화 상대의 응답으로 제공할 수 있다.According to another aspect of the present disclosure, a user terminal providing a chatbot service includes one or more processors; and a memory storing one or more instructions to be executed by the one or more processors, wherein the one or more processors, by executing the one or more instructions, obtain a first query for a specific conversation partner from a user, and the user , load characteristic information related to the conversation partner or the contents of a conversation between the conversation partner and the user, generate a system prompt corresponding to the characteristic information, and generate a user prompt and the system prompt corresponding to the first query. 1 input into a language model, and the output of the first language model may be provided as the conversation partner's response to the first query.

본 개시의 또 다른 측면은 전자 장치에 의해 수행되는 방법을 구현하기 위한 프로그램이 기록된 컴퓨터로 판독 가능한 기록 매체를 제공할 수 있다.Another aspect of the present disclosure may provide a computer-readable recording medium on which a program for implementing a method performed by an electronic device is recorded.

기타 실시 예들의 구체적인 사항들은 상세한 설명 및 도면들에 포함되어 있다.Specific details of other embodiments are included in the detailed description and drawings.

본 개시에 따르면, 연예인, 셀럽, 또는 인기 캐릭터를 본딴 가상의 대화 상대와 대화를 나누는 챗봇 서비스에 있어서, 연예인, 셀럽, 또는 인기 캐릭터의 성격, 습관, 사실 관계, 대화와 관련된 기억 등을 대화 상대의 응답에 반영함으로써 마치 대화 상대에 연예인, 셀럽, 또는 인기 캐릭터의 자아가 체화된 인상을 줄 수 있고, 이를 통해 특정 연예인, 셀럽이나 캐릭터와 대화하는 듯한 경험을 제공할 수 있다.According to the present disclosure, in a chatbot service for having a conversation with a virtual conversation partner modeled after a celebrity, celebrity, or popular character, the personality, habits, facts, memories related to the conversation, etc. of the celebrity, celebrity, or popular character are shared with the conversation partner. By reflecting the response, you can give the conversation partner the impression that the ego of the celebrity, celebrity, or popular character is embodied, and through this, you can provide an experience as if you are talking to a specific celebrity, celebrity, or character.

또한, 본 개시에 따르면, 입력되는 쿼리나 생성되는 응답에서 프롬프트 유출이나 잘못된 데이터를 주입하려는 유형의 공격을 미리 검출하고 차단함으로써, 챗봇 서비스의 노하우가 알려지거나 챗봇 서비스의 퀄리티가 저하되는 것을 방지할 수 있다.In addition, according to the present disclosure, it is possible to prevent the know-how of the chatbot service from becoming known or the quality of the chatbot service from being degraded by detecting and blocking in advance attacks that attempt to leak prompts or inject incorrect data from input queries or generated responses. You can.

또한, 본 개시에 따르면, 사용자의 비속어 입력이나 민감한 주제에 대한 입력을 제한함으로써, 챗봇 서비스가 사회적으로 물의가 되는 방향으로 과도하게 활용되는 것을 방지할 수 있다.Additionally, according to the present disclosure, by restricting the user's input of slang or sensitive topics, it is possible to prevent the chatbot service from being excessively used in a socially controversial way.

발명의 효과는 이상에서 언급한 효과로 제한되지 않으며, 언급되지 않은 또 다른 효과들은 청구범위의 기재로부터 당해 기술 분야의 통상의 기술자에게 명확하게 이해될 수 있을 것이다.The effect of the invention is not limited to the effects mentioned above, and other effects not mentioned will be clearly understood by those skilled in the art from the description of the claims.

도 1은 챗봇 서비스를 제공하는 사용자 단말의 구동 환경을 나타낸 개략적인 구성도이다.
도 2는 제1 실시 예에 따른 챗봇 서비스 제공 방법의 흐름도이다.
도 3 내지 도 6은 제1 실시 예와 관련된, 추가적인 챗봇 서비스 제공 방법의 흐름도이다.
도 7은 제2 실시 예에 따른 챗봇 서비스 제공 방법의 흐름도이다.
도 8은 제3 실시 예에 따른 챗봇 서비스 제공 방법의 흐름도이다.
도 9는 챗봇 서비스 제공을 위한 전반적인 아키텍처의 일 예시이다.
도 10은 제1 언어 모델을 통해 대화 상대의 응답을 출력하는 구체화된 아키텍처의 일 예시이다.
도 11a 및 도 11b는 챗봇 서비스가 적용된 애플리케이션에서 대화 상대를 선택하는 화면의 일 예시이다.
도 12a 및 도 12b는 챗봇 서비스가 적용된 애플리케이션 내 대화 화면의 일 예시이다.
도 13은 일 실시 예에 따른 사용자 단말의 블록도를 나타낸다.
Figure 1 is a schematic configuration diagram showing the operating environment of a user terminal providing a chatbot service.
Figure 2 is a flowchart of a chatbot service provision method according to the first embodiment.
3 to 6 are flowcharts of a method for providing additional chatbot services related to the first embodiment.
Figure 7 is a flowchart of a chatbot service provision method according to a second embodiment.
Figure 8 is a flowchart of a chatbot service provision method according to a third embodiment.
Figure 9 is an example of the overall architecture for providing chatbot services.
Figure 10 is an example of a concrete architecture that outputs a conversation partner's response through a first language model.
Figures 11a and 11b are examples of screens for selecting a conversation partner in an application to which a chatbot service is applied.
Figures 12a and 12b are examples of conversation screens within an application to which the chatbot service is applied.
Figure 13 shows a block diagram of a user terminal according to one embodiment.

이하, 도면을 참조하여 구체적인 실시 형태를 설명하기로 한다. 이하의 상세한 설명은 본 명세서에서 기술된 방법, 장치 및/또는 시스템에 대한 포괄적인 이해를 돕기 위해 제공된다. 그러나 이는 예시에 불과하며 개시되는 실시 예들은 이에 제한되지 않는다.Hereinafter, specific embodiments will be described with reference to the drawings. The detailed description below is provided to provide a comprehensive understanding of the methods, devices and/or systems described herein. However, this is only an example, and the disclosed embodiments are not limited thereto.

실시 예들을 설명함에 있어서, 관련된 공지기술에 대한 구체적인 설명이 개시되는 실시 예들의 요지를 불필요하게 흐릴 수 있다고 판단되는 경우에는 그 상세한 설명을 생략하기로 한다. 그리고, 후술되는 용어들은 개시되는 실시예들에서의 기능을 고려하여 정의된 용어들로서 이는 사용자, 운용자의 의도 또는 관례 등에 따라 달라질 수 있다. 그러므로 그 정의는 본 명세서 전반에 걸친 내용을 토대로 내려져야 할 것이다. 상세한 설명에서 사용되는 용어는 단지 실시 예들을 기술하기 위한 것이며, 결코 제한적이어서는 안 된다. 명확하게 달리 사용되지 않는 한, 단수 형태의 표현은 복수 형태의 의미를 포함한다. 본 설명에서, "포함" 또는 "구비"와 같은 표현은 어떤 특성들, 숫자들, 단계들, 동작들, 요소들, 이들의 일부 또는 조합을 가리키기 위한 것이며, 기술된 것 이외에 하나 또는 그 이상의 다른 특성, 숫자, 단계, 동작, 요소, 이들의 일부 또는 조합의 존재 또는 가능성을 배제하도록 해석되어서는 안 된다.In describing the embodiments, if it is determined that a detailed description of the related known technology may unnecessarily obscure the gist of the disclosed embodiments, the detailed description will be omitted. In addition, terms described below are terms defined in consideration of functions in the disclosed embodiments, and may vary depending on the intention or custom of the user or operator. Therefore, the definition should be made based on the contents throughout this specification. The terminology used in the detailed description is only for describing embodiments and should in no way be limiting. Unless explicitly stated otherwise, singular forms include plural meanings. In this description, expressions such as “comprising” or “comprising” are intended to indicate certain features, numbers, steps, operations, elements, parts or combinations thereof, and one or more than those described. It should not be construed to exclude the existence or possibility of any other characteristic, number, step, operation, element, or part or combination thereof.

실시 예들에서 사용되는 용어는 본 개시에서의 기능을 고려하면서 가능한 현재 널리 사용되는 일반적인 용어들을 선택하였으나, 이는 당 분야에 종사하는 기술자의 의도 또는 판례, 새로운 기술의 출현 등에 따라 달라질 수 있다. 또한, 특정한 경우는 출원인이 임의로 선정한 용어도 있으며, 이 경우 해당되는 설명 부분에서 상세히 그 의미를 기재할 것이다. 따라서 본 개시에서 사용되는 용어는 단순한 용어의 명칭이 아닌, 그 용어가 가지는 의미와 본 개시의 전반에 걸친 내용을 토대로 정의되어야 한다.The terms used in the embodiments are general terms that are currently widely used as much as possible while considering the functions in the present disclosure, but this may vary depending on the intention or precedent of a person working in the art, the emergence of new technology, etc. In addition, in certain cases, there are terms arbitrarily selected by the applicant, and in this case, the meaning will be described in detail in the relevant description. Therefore, the terms used in this disclosure should be defined based on the meaning of the term and the overall content of this disclosure, rather than simply the name of the term.

명세서 전체에서 어떤 부분이 어떤 구성요소를 "포함"한다고 할 때, 이는 특별히 반대되는 기재가 없는 한 다른 구성요소를 제외하는 것이 아니라 다른 구성요소를 더 포함할 수 있음을 의미한다. 또한, 명세서에 기재된 "..부", "..모듈" 등의 용어는 적어도 하나의 기능이나 동작을 처리하는 단위를 의미하고, 이는 하드웨어 또는 소프트웨어로 구현되거나 하드웨어와 소프트웨어의 결합으로 구현될 수 있으며, 도시된 예와 달리 구체적 동작에 있어 명확히 구분되지 않을 수 있다.When it is said that a part "includes" a certain element throughout the specification, this means that, unless specifically stated to the contrary, it does not exclude other elements but may further include other elements. In addition, terms such as “..unit” and “..module” used in the specification refer to a unit that processes at least one function or operation, which may be implemented as hardware or software, or as a combination of hardware and software. And, unlike the example shown, specific operations may not be clearly distinguished.

명세서 전체에서 기재된 "a, b, 및 c 중 적어도 하나"의 표현은, 'a 단독', 'b 단독', 'c 단독', 'a 및 b', 'a 및 c', 'b 및 c', 또는 'a, b, 및 c 모두'를 포괄할 수 있다.The expression “at least one of a, b, and c” used throughout the specification means ‘a alone’, ‘b alone’, ‘c alone’, ‘a and b’, ‘a and c’, ‘b and c ', or 'all of a, b, and c'.

이하에서 언급되는 "단말"은 네트워크를 통해 서버나 타 단말에 접속할 수 있는 컴퓨터나 휴대용 단말로 구현될 수 있다. 여기서, 컴퓨터는 예를 들어, 웹 브라우저(WEB Browser)가 탑재된 노트북, 데스크톱(desktop), 랩톱(laptop) 등을 포함하고, 휴대용 단말은 예를 들어, 휴대성과 이동성이 보장되는 무선 통신 장치로서, IMT(International Mobile Telecommunication), CDMA(Code Division Multiple Access), W-CDMA(W-Code Division Multiple Access), LTE(Long Term Evolution) 등의 통신 기반 단말, 스마트폰, 태블릿 PC 등과 같은 모든 종류의 핸드헬드(Handheld) 기반의 무선 통신 장치를 포함할 수 있다.The “terminal” mentioned below may be implemented as a computer or portable terminal that can connect to a server or other terminal through a network. Here, the computer includes, for example, a laptop, desktop, laptop, etc. equipped with a web browser, and the portable terminal is, for example, a wireless communication device that guarantees portability and mobility. , all types of communication-based terminals such as IMT (International Mobile Telecommunication), CDMA (Code Division Multiple Access), W-CDMA (W-Code Division Multiple Access), and LTE (Long Term Evolution), smartphones, tablet PCs, etc. It may include a handheld-based wireless communication device.

이하의 설명에 있어서, 신호 또는 정보의 "전송", "통신", "송신", "수신" 기타 이와 유사한 의미의 용어는 일 구성요소에서 다른 구성요소로 신호 또는 정보가 직접 전달되는 것뿐만이 아니라 다른 구성요소를 거쳐 전달되는 것도 포함한다.In the following description, "transmission", "communication", "transmission", "reception" and other similar terms of a signal or information refer not only to the direct transmission of a signal or information from one component to another component. It also includes those transmitted through other components.

특히 신호 또는 정보를 일 구성요소로 "전송" 또는 "송신"한다는 것은 그 신호 또는 정보의 최종 목적지를 지시하는 것이고 직접적인 목적지를 의미하는 것이 아니다. 이는 신호 또는 정보의 "수신"에 있어서도 동일하다. 또한 본 명세서에 있어서, 2 이상의 데이터 또는 정보가 "관련"된다는 것은 하나의 데이터(또는 정보)를 획득하면, 그에 기초하여 다른 데이터(또는 정보)의 적어도 일부를 획득할 수 있음을 의미한다.In particular, “transmitting” or “transmitting” a signal or information as a component indicates the final destination of the signal or information and does not mean the direct destination. This is the same for “receiving” signals or information. Also, in this specification, “related” to two or more data or information means that if one data (or information) is acquired, at least part of other data (or information) can be obtained based on it.

또한, 제1, 제2 등의 용어는 다양한 구성 요소들을 설명하는데 사용될 수 있지만, 상기 구성 요소들은 상기 용어들에 의해 한정되어서는 안 된다. 상기 용어들은 하나의 구성 요소를 다른 구성 요소로부터 구별하는 목적으로 사용될 수 있다.Additionally, terms such as first and second may be used to describe various components, but the components should not be limited by the terms. The above terms may be used for the purpose of distinguishing one component from another component.

예를 들어, 본 발명의 권리 범위를 벗어나지 않으면서 제1 구성 요소는 제2 구성 요소로 명명될 수 있고, 유사하게 제2 구성 요소도 제1 구성 요소로 명명될 수 있다.For example, a first component may be referred to as a second component, and similarly, the second component may also be referred to as a first component without departing from the scope of the present invention.

실시 예를 설명함에 있어서 본 발명이 속하는 기술 분야에 익히 알려져 있고 본 발명과 직접적으로 관련이 없는 기술 내용에 대해서는 설명을 생략한다. 이는 불필요한 설명을 생략함으로써 본 발명의 요지를 흐리지 않고 더욱 명확히 전달하기 위함이다.In describing the embodiments, description of technical content that is well known in the technical field to which the present invention belongs and that is not directly related to the present invention will be omitted. This is to convey the gist of the present invention more clearly without obscuring it by omitting unnecessary explanation.

마찬가지 이유로 첨부 도면에 있어서 일부 구성요소는 과장되거나 생략되거나 개략적으로 도시되었다. 또한, 각 구성요소의 크기는 실제 크기를 전적으로 반영하는 것이 아니다. 각 도면에서 동일한 또는 대응하는 구성요소에는 동일한 참조 번호를 부여하였다.For the same reason, some components are exaggerated, omitted, or schematically shown in the accompanying drawings. Additionally, the size of each component does not entirely reflect its actual size. In each drawing, identical or corresponding components are assigned the same reference numbers.

본 발명의 이점 및 특징, 그리고 그것들을 달성하는 방법은 첨부되는 도면과 함께 상세하게 후술되어 있는 실시 예들을 참조하면 명확해질 것이다. 그러나 본 발명은 이하에서 개시되는 실시 예들에 한정되는 것이 아니라 서로 다른 다양한 형태로 구현될 수 있으며, 단지 본 실시 예들은 본 발명의 개시가 완전하도록 하고, 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에게 발명의 범주를 완전하게 알려주기 위해 제공되는 것이며, 본 발명은 청구항의 범주에 의해 정의될 뿐이다. 명세서 전체에 걸쳐 동일 참조 부호는 동일 구성 요소를 지칭한다.The advantages and features of the present invention and methods for achieving them will become clear by referring to the embodiments described in detail below along with the accompanying drawings. However, the present invention is not limited to the embodiments disclosed below and may be implemented in various different forms. The present embodiments are merely provided to ensure that the disclosure of the present invention is complete and to provide common knowledge in the technical field to which the present invention pertains. It is provided to fully inform those who have the scope of the invention, and the present invention is only defined by the scope of the claims. Like reference numerals refer to like elements throughout the specification.

처리 흐름도 도면들의 각 블록과 흐름도 도면들의 조합들은 컴퓨터 프로그램 인스트럭션들에 의해 수행될 수 있음을 이해할 수 있을 것이다. 이들 컴퓨터 프로그램 인스트럭션들은 범용 컴퓨터, 특수용 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비의 프로세서에 탑재될 수 있으므로, 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비의 프로세서를 통해 수행되는 그 인스트럭션들이 흐름도 블록(들)에서 설명된 기능들을 수행하는 수단을 생성하게 된다. 이들 컴퓨터 프로그램 인스트럭션들은 특정 방식으로 기능을 구현하기 위해 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비를 지향할 수 있는 컴퓨터 이용 가능 또는 컴퓨터 판독 가능 메모리에 저장되는 것도 가능하므로, 그 컴퓨터 이용 가능 또는 컴퓨터 판독 가능 메모리에 저장된 인스트럭션들은 흐름도 블록(들)에서 설명된 기능을 수행하는 인스트럭션 수단을 내포하는 제조 품목을 생산하는 것도 가능하다. 컴퓨터 프로그램 인스트럭션들은 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비 상에 탑재되는 것도 가능하므로, 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비 상에서 일련의 동작 단계들이 수행되어 컴퓨터로 실행되는 프로세스를 생성해서 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비를 수행하는 인스트럭션들은 흐름도 블록(들)에서 설명된 기능들을 실행하기 위한 단계들을 제공하는 것도 가능하다.It will be understood that each block of the processing flow diagrams and combinations of the flow diagram diagrams may be performed by computer program instructions. These computer program instructions can be mounted on a processor of a general-purpose computer, special-purpose computer, or other programmable data processing equipment, so that the instructions performed through the processor of the computer or other programmable data processing equipment are described in the flow chart block(s). It creates the means to perform functions. These computer program instructions may also be stored in computer-usable or computer-readable memory that can be directed to a computer or other programmable data processing equipment to implement a function in a particular manner, so that the computer-usable or computer-readable memory It is also possible to produce manufactured items containing instruction means that perform the functions described in the flowchart block(s). Computer program instructions can also be mounted on a computer or other programmable data processing equipment, so that a series of operational steps are performed on the computer or other programmable data processing equipment to create a process that is executed by the computer, thereby generating a process that is executed by the computer or other programmable data processing equipment. Instructions that perform processing equipment may also provide steps for executing the functions described in the flow diagram block(s).

또한, 각 블록은 특정된 논리적 기능(들)을 실행하기 위한 하나 이상의 실행 가능한 인스트럭션들을 포함하는 모듈, 세그먼트 또는 코드의 일부를 나타낼 수 있다. 또, 몇 가지 대체 실행 예들에서는 블록들에서 언급된 기능들이 순서를 벗어나서 발생하는 것도 가능함을 주목해야 한다. 예컨대, 잇달아 도시되어 있는 두 개의 블록들은 사실 실질적으로 동시에 수행되는 것도 가능하고 또는 그 블록들이 때때로 해당하는 기능에 따라 역순으로 수행되는 것도 가능하다.Additionally, each block may represent a module, segment, or portion of code that includes one or more executable instructions for executing specified logical function(s). Additionally, it should be noted that in some alternative execution examples it is possible for the functions mentioned in the blocks to occur out of order. For example, it is possible for two blocks shown in succession to be performed substantially at the same time, or it is possible for the blocks to be performed in reverse order depending on the corresponding function.

아래에서는 첨부한 도면을 참고하여 본 개시의 실시 예에 대하여 본 개시가 속하는 기술 분야에서 통상의 지식을 가진 자가 용이하게 실시할 수 있도록 상세히 설명한다. 그러나 본 개시는 여러 가지 상이한 형태로 구현될 수 있으며 여기에서 설명하는 실시 예에 한정되지 않는다. 도 2 내지 12b에 도시된 방법은 예를 들어, 도 1 또는 도 13을 참조하여 설명하는 사용자 단말(110)에 의해 수행될 수 있다. 즉, 사용자 단말(110)은 본 개시에 있어서 챗봇 서비스의 제공을 위한 예시적인 장치로, 단일한 장치일 수도 있지만, 실시 예에 따라서는 유선 또는 무선의 네트워크를 통해 서로 통신하는 복수의 세부 장치로 구성된 시스템일 수도 있다.Below, with reference to the attached drawings, embodiments of the present disclosure will be described in detail so that those skilled in the art can easily practice them. However, the present disclosure may be implemented in many different forms and is not limited to the embodiments described herein. The method shown in FIGS. 2 to 12B may be performed, for example, by the user terminal 110 described with reference to FIG. 1 or FIG. 13 . That is, the user terminal 110 is an exemplary device for providing a chatbot service in the present disclosure, and may be a single device, but depending on the embodiment, it may be comprised of a plurality of detailed devices that communicate with each other through a wired or wireless network. It may be a structured system.

도 1은 챗봇 서비스를 제공하는 사용자 단말의 구동 환경을 나타낸 개략적인 구성도이다.Figure 1 is a schematic configuration diagram showing the operating environment of a user terminal providing a chatbot service.

도 2는 제1 실시 예에 따른 챗봇 서비스 제공 방법의 흐름도이다.Figure 2 is a flowchart of a chatbot service provision method according to the first embodiment.

사용자 단말(110)은 특정 대화 상대에 대한 제1 쿼리를 획득할 수 있다(S210). 다음으로, 사용자 단말(110)은 사용자, 대화 상대 또는 대화 상대와 사용자 사이의 대화 내용과 관련된 특성 정보를 로드할 수 있다(S220). 다음으로, 사용자 단말(110)은 로드된 특성 정보에 대응하는 시스템 프롬프트를 생성할 수 있다(S230). 다음으로, 사용자 단말(110)은 생성된 시스템 프롬프트 및, 제1 쿼리에 대응하는 사용자 프롬프트를 제1 언어 모델에 입력할 수 있다(S240). 다음으로, 사용자 단말(110)은 제1 언어 모델의 출력을 제1 쿼리에 대한 대화 상대의 응답으로 제공할 수 있다(S250). 본 개시에 있어서, '사용자 프롬프트'는 제1 쿼리를 제1 언어 모델에 입력할 사용자 프롬프트 양식에 맞게 변환한 정보를 의미하고, '시스템 프롬프트'는 제1 쿼리로부터 확인된 정보(사용자, 대화 상대 또는 대화 내용과 관련된 특성 정보를 포함)에 대응하는 시스템 프롬프트 양식에 맞게 변환한 정보를 의미한다.The user terminal 110 may obtain a first query for a specific conversation partner (S210). Next, the user terminal 110 may load characteristic information related to the user, a conversation partner, or the contents of a conversation between the conversation partner and the user (S220). Next, the user terminal 110 may generate a system prompt corresponding to the loaded characteristic information (S230). Next, the user terminal 110 may input the generated system prompt and the user prompt corresponding to the first query into the first language model (S240). Next, the user terminal 110 may provide the output of the first language model as the conversation partner's response to the first query (S250). In the present disclosure, 'user prompt' refers to information converted from the first query to fit the user prompt form to be input into the first language model, and 'system prompt' refers to information (user, conversation partner, etc.) confirmed from the first query. This refers to information converted to fit the system prompt format corresponding to the conversation content (including characteristic information related to the conversation content).

일 실시 예에 따르면, 사용자 단말(110)은 사용자 단말(110) 내부의 저장 공간 또는 네트워크(130)를 통해 통신하는 서버(120)로부터 특성 정보를 로드할 수 있다. 특성 정보는 사용자와 관련된 제1 특성 정보, 대화 상대와 관련된 제2 특성 정보, 또는 대화 상대와 사용자 사이의 대화 내용과 관련된 제3 특성 정보 중 적어도 일부를 포함할 수 있다.According to one embodiment, the user terminal 110 may load characteristic information from a storage space inside the user terminal 110 or from a server 120 that communicates through the network 130. The characteristic information may include at least some of first characteristic information related to the user, second characteristic information related to the conversation partner, or third characteristic information related to the content of the conversation between the conversation partner and the user.

사용자와 관련된 제1 특성 정보에는, 사용자의 챗봇 서비스 회원가입 시 수집된 정보가 포함될 수 있다. 사용자는 챗봇 서비스에 가입 시 미리 구현된 양식에 따라 성명, 나이, 생년월일, MBTI, 성별, 관심사, 관심있는 대화 상대 등의 정보를 직접 입력하게 되며, 사용자 단말(110)은 이렇게 수집된 정보 중 제1 쿼리에 대한 대화 상대의 응답을 생성하는 데 유용한 정보를 로드할 수 있다. 수집된 정보 중 응답 생성에 유용한 정보를 식별하는 방식은 다양하게 정의될 수 있는데, 예컨대 사용자 단말(110)은 제1 쿼리에 대응하는 키워드를 식별하고, 수집된 정보 중 키워드에 대응하는 정보가 존재할 경우 그 정보를 로드할 수 있다. 사용자가 A라는 대화 상대와 대화하면서 A에게 "취미가 뭐야?"라고 질문했다면, 사용자 단말(110)은 '취미'라는 키워드를 식별하고, 수집된 정보 중 사용자의 관심사가 '음악감상'이라는 정보를 로드하여 "내 취미는 요리야. 너는 음악 듣는 걸 좋아하니?"라는 응답을 제공할 수 있다. 제1 특성 정보는 사용자 단말(110)의 저장 공간 또는 서버(120)의 저장 공간에 저장되어 있을 수 있다.The first characteristic information related to the user may include information collected when the user signs up for membership in the chatbot service. When signing up for the chatbot service, the user directly enters information such as name, age, date of birth, MBTI, gender, interests, and interested conversation partners according to a pre-implemented form, and the user terminal 110 selects the first of the information collected in this way. 1 You can load useful information to generate your interlocutor's response to your query. Methods for identifying information useful for generating a response among the collected information may be defined in various ways. For example, the user terminal 110 identifies a keyword corresponding to the first query, and determines whether information corresponding to the keyword may exist among the collected information. If so, you can load that information. If a user asks A, “What is your hobby?” while talking with a conversation partner, the user terminal 110 identifies the keyword “hobby,” and among the collected information, information that the user’s interest is “listening to music.” to provide a response like "My hobby is cooking. Do you like listening to music?" The first characteristic information may be stored in the storage space of the user terminal 110 or the storage space of the server 120.

대화 상대와 관련된 제2 특성 정보에는, 대화 상대의 대화 스타일 데이터를 포함하는 페르소나 정보 또는 대화 상대의 사실 관계 정보 중 적어도 일부가 포함될 수 있다. 제2 특성 정보는 웹 크롤링(Web Crawling)을 통해 수집되거나, 기 설정된 협약 조건에 따라 대화 상대의 매니지먼트 서버로부터 전송된 정보일 수 있다. 이때, 사용자 단말(110)이 웹 크롤링을 직접 수행하거나 매니지먼트 서버로부터 정보를 직접 전송 받을 수도 있지만, 실시 예에 따라서는 서버(120)가 웹 크롤링을 수행하고 수집된 제2 특성 정보를 사용자 단말(110)로 전송하거나, 서버(120)가 먼저 매니지먼트 서버로부터 제2 특성 정보를 수신하고 사용자 단말(110)로 전송할 수도 있다.The second characteristic information related to the conversation partner may include at least part of persona information including conversation style data of the conversation partner or factual relationship information of the conversation partner. The second characteristic information may be information collected through web crawling or transmitted from the management server of the conversation partner according to preset agreement conditions. At this time, the user terminal 110 may directly perform web crawling or receive information directly from the management server, but depending on the embodiment, the server 120 performs web crawling and sends the collected second characteristic information to the user terminal ( 110), or the server 120 may first receive the second characteristic information from the management server and transmit it to the user terminal 110.

본 개시에서, '페르소나 정보'는 대화 상대의 어투, 높은 빈도로 사용하는 단어나 이모티콘 등의 언어 습관, 텍스트 입력 방식 등 대화 상대의 대화 스타일에 관한 데이터를 총칭한다. 예컨대, 페르소나 정보는 대화 상대의 실제 대화 데이터 셋에 포함된 정보로(이때, 실제 대화 데이터 셋은 임베딩 벡터의 형태로 사용자 단말(110) 내부의 저장 공간 또는 별도의 벡터 저장소에 저장될 수도 있음, 예를 들어 Pinecone), 제1 언어 모델은 페르소나 정보를 학습 데이터로 하여 퓨 샷 러닝(Few-shot learning) 기법을 통해 학습된 인공지능 모델일 수 있다. 연예인의 실제 대화 내용이나, 가상 캐릭터의 정식 컨텐츠(예를 들어, 정규 애니메이션이나 정식 발매된 게임 등) 내 대화 내용은 희소할 수 있으므로, 퓨 샷 러닝 기법을 통한 학습이 효과적일 수 있다.In this disclosure, 'persona information' is a general term for data regarding the conversational style of the conversational partner, such as the conversationalist's tone of voice, language habits such as words or emoticons used frequently, and text input method. For example, persona information is information included in the actual conversation data set of the conversation partner (in this case, the actual conversation data set may be stored in the storage space inside the user terminal 110 in the form of an embedding vector or in a separate vector storage, For example, Pinecone), the first language model may be an artificial intelligence model learned through a few-shot learning technique using persona information as learning data. Since the actual conversation content of a celebrity or the conversation content within the official content of a virtual character (e.g., regular animation or officially released game, etc.) may be rare, learning through the few-shot learning technique can be effective.

한편, 본 개시에서 대화 상대의 '사실 관계 정보'는 대화 상대의 성별, 생년월일 등과 같은 프로필 정보, 대화 상대와 다른 제3자 간의 사회적 관계에 대한 정보, 대화 상대의 활동 이력 등, 대외적으로 공개된 대화 상대의 정보를 총칭한다. 사실 관계 정보는 대화 상대 별 정보가 미리 설정된 하이퍼파라미터(Hyper-parameter, 예컨대 청크 사이즈(Chunk size) 및 오버랩 사이즈(Overlap size) 등)에 기반하여 분해된 이후, 임베딩 벡터로 변환되어 사용자 단말(110) 내부의 저장 공간 또는 외부의 벡터 저장소에 저장된 것일 수 있다. 관련하여, 사용자 단말(110)은 사실 관계 정보를 로드 시, 특정된 대화 상대의 사실 관계에 대응하는 복수의 임베딩 벡터 중 제1 쿼리와의 유사도를 비교하여 유사도가 임계 값 이상인 임베딩 벡터를 특정된 대화 상대의 사실 관계 정보로 로드할 수 있다.Meanwhile, in this disclosure, the 'factual relationship information' of the interlocutor is publicly disclosed, such as profile information such as the interlocutor's gender and date of birth, information about social relationships between the interlocutor and other third parties, and the interlocutor's activity history. A general term for information about the person you are talking to. The factual relationship information is decomposed based on hyper-parameters (such as chunk size and overlap size, etc.) for which each conversation partner is preset, and then converted to an embedding vector at the user terminal (110). ) It may be stored in an internal storage space or an external vector storage. In relation to this, when loading the factual relationship information, the user terminal 110 compares the similarity with the first query among a plurality of embedding vectors corresponding to the factual relationship of the specified conversation partner and selects an embedding vector whose similarity is greater than or equal to a threshold value. It can be loaded with factual information about the person you are talking to.

제2 특성 정보는 사용자 단말(110)의 저장 공간 또는 서버(120)의 저장 공간에 저장되어 있을 수 있다.The second characteristic information may be stored in the storage space of the user terminal 110 or the storage space of the server 120.

대화 상대와 사용자 사이의 대화 내용과 관련된 제3 특성 정보에는, 대화 내용 중 사용자의 입력의 적어도 일부가 추출되어 저장된 중장기 기억 정보 또는 대화 내용 중 최근 N개(단, N은 자연수)의 대화 내용이 저장된 단기 기억 정보 중 적어도 일부가 포함될 수 있다. 구체적으로, 중장기 기억 정보는 미리 설정된 카테고리(예컨대, 애완동물, 가족, 직업 등)에 해당하는 정보, 미리 설정된 예시(예컨대, 사용자는 카레를 싫어함)와 유사한 내용의 정보를 포함할 수 있다. 이 중 미리 설정된 예시와 유사한 내용의 정보를 분류하는 과정에서는 오류가 발생할 수도 있으므로, 사용자 단말(110)은 분류된 정보(미리 설정된 예시와 유사하여 중장기 기억 정보로 분류된 정보)를 사용자 인터페이스(User Interface, UI)를 통해 사용자에게 제공하고, UI를 통해 사용자가 삭제를 요청할 시 중장기 기억 정보로서 저장하지 않고 삭제할 수도 있다. 사용자 단말(110)은 일련의 대화 내용 중 중장기 기억 정보로 추출할 내용이 없다고 판단되면, 제3 특성 정보로 단기 기억 정보만을 저장할 수도 있다. 마찬가지로, 사용자 단말(110)은 로드 시에도 중장기 기억 정보 중 로드할 내용이 없을 시에는, 단기 기억 정보만을 로드할 수도 있다.The third characteristic information related to the conversation content between the conversation partner and the user includes mid- to long-term memory information in which at least part of the user's input is extracted and stored from the conversation content, or the most recent N conversation contents (where N is a natural number) among the conversation content. At least some of the stored short-term memory information may be included. Specifically, mid- to long-term memory information may include information corresponding to a preset category (eg, pet, family, occupation, etc.) and information similar to a preset example (eg, the user hates curry). Among these, errors may occur in the process of classifying information similar to preset examples, so the user terminal 110 displays classified information (information classified as mid- to long-term memory information due to similarity to preset examples) through a user interface (User It is provided to the user through the Interface (UI), and when the user requests deletion through the UI, it can be deleted without storing it as mid- to long-term memory information. If the user terminal 110 determines that there is no content to be extracted as mid- to long-term memory information from a series of conversation contents, it may store only short-term memory information as third characteristic information. Similarly, even when loading, the user terminal 110 may load only short-term storage information if there is no content to load among the mid- to long-term storage information.

중장기 기억 정보와 단기 기억 정보를 저장되는 위치에 따라 구분하면, 중장기 기억 정보는 사용자 단말(110)의 내장 메모리에 저장될 수 있으며, 단기 기억 정보는 사용자 단말(110)의 랜덤 액세스 메모리(Random Access Memory, RAM)에 저장될 수 있다. 단기 기억 정보를 RAM에 저장함으로써, 제1 쿼리와 관련성이 높은 쿼리가 가까운 시간 내에 입력되었을 때(사용자가 비슷한 질문을 이어서 입력하는 경우 등), RAM으로부터 단기 기억 정보를 신속히 로드하여 응답 생성에 소요되는 지연(latency)을 줄일 수 있다. 단기 기억 정보로서 저장되는 대화 내용의 개수를 설정하는 변수 N은 챗봇 서비스 제공자에 의해 설정되는 하이퍼파라미터일 수 있다. 챗봇 서비스 제공자는 제1 언어 모델의 토큰 사용량(Token usage)과 응답의 성능(Performance of answer)을 고려하여 N을 설정할 수 있다. 반면 중장기 기억 정보는 비교적 오래 저장될 필요가 있는 정보이므로, 휘발성이 강한 RAM에 저장하는 것은 적합하지 않고, 서버(120)에 저장하기에는 챗봇 서비스를 이용하는 사용자의 증가에 따라 서버(120)에 저장될 중장기 기억 정보의 양이 급증할 우려가 있고 서버(120)로부터 특정 대화 상대와의 대화 내용과 관련된 중장기 기억 정보를 검색하여 로드하는 것도 상당한 지연이 발생할 것이므로, 사용자 단말(110)의 내장 메모리에 저장하는 것이 적합할 수 있다.If mid- to long-term memory information and short-term memory information are classified according to where they are stored, mid- to long-term memory information may be stored in the built-in memory of the user terminal 110, and short-term memory information may be stored in the random access memory of the user terminal 110. Memory, RAM). By storing short-term memory information in RAM, when a query that is highly related to the first query is entered within a short period of time (such as when a user enters similar questions in succession), short-term memory information is quickly loaded from RAM to generate a response. Latency can be reduced. The variable N, which sets the number of conversation contents stored as short-term memory information, may be a hyperparameter set by the chatbot service provider. The chatbot service provider can set N by considering the token usage and performance of the answer of the first language model. On the other hand, mid- to long-term memory information is information that needs to be stored for a relatively long time, so it is not appropriate to store it in highly volatile RAM, and it is not suitable to store it in the server 120 as the number of users using the chatbot service increases. There is a risk that the amount of mid- to long-term memory information will rapidly increase, and there will be a significant delay in retrieving and loading mid- to long-term memory information related to conversation content with a specific conversation partner from the server 120, so it is stored in the internal memory of the user terminal 110. It may be appropriate to do so.

한편, 중장기 기억 정보를 형식적으로 구분하면, 중장기 기억 정보에는 JavaScript Object Notation(JSON) 파일 형식으로 저장되는 제1 중장기 기억 정보 또는 임베딩 벡터로 변환되어 바이너리(BIN) 파일 형식으로 저장되는 제2 중장기 기억 정보 중 적어도 일부가 포함될 수 있다. 예컨대, 중장기 기억 정보 일체는 모두 제1 중장기 기억 정보로서 JSON 파일 형식으로 내장 메모리에 저장되고, 그 중 장기 기억 정보로 보다 오래 저장되어야 하는 정보는 제2 중장기 기억 정보로서 임베딩 벡터로 변환되어 BIN 파일 형식으로도 추가적으로 저장될 수 있다. 다만 본 명세서에서, 제1 중장기 기억 정보의 저장 형식은 JSON 파일 형식으로 한정되는 것은 아니며, 키-값(Key-Value) 형태의 딕셔너리(dictionary)로 저장되는 일체의 파일 형식으로 대체될 수도 있다. 한편 임베딩 벡터로 저장된 제2 중장기 기억 정보는 사용자 단말(110)이 로드 시, 상술한 사실 관계 정보와 유사하게, 특정된 대화 상대에 대응하는 제2 중장기 기억 정보 중 제1 쿼리와의 유사도를 비교하여 유사도가 임계 값 이상인 임베딩 벡터를 특정된 대화 상대의 응답 생성에 활용될 제2 중장기 기억 정보로 로드할 수 있다.Meanwhile, if mid- to long-term memory information is formally classified, the mid- to long-term memory information includes first mid- to long-term memory information stored in JavaScript Object Notation (JSON) file format, or second mid- to long-term memory converted to an embedding vector and stored in binary (BIN) file format. At least some of the information may be included. For example, all mid- to long-term memory information is stored in the internal memory in a JSON file format as first mid- to long-term memory information, and among them, information that needs to be stored longer as long-term memory information is converted to an embedding vector as second mid- to long-term memory information and is converted to a BIN file. It can also be additionally saved in this format. However, in this specification, the storage format of the first mid- to long-term memory information is not limited to the JSON file format, and may be replaced with any file format stored as a dictionary in the form of a key-value. Meanwhile, when the user terminal 110 loads the second mid- to long-term memory information stored as an embedding vector, the similarity with the first query among the second mid- to long-term memory information corresponding to the specified conversation partner is compared, similar to the above-described factual relationship information. Thus, an embedding vector with a similarity value greater than or equal to a threshold can be loaded into second mid- to long-term memory information to be used to generate a response from a specified conversation partner.

일 실시 예에 따르면, 사용자 단말(110)은 단계 S230에서, 특성 정보를 구성하는 요소 각각을 기 정의된 시스템 프롬프트 템플릿의 인자로 입력하고, 시스템 프롬프트 템플릿의 출력 값에 순차(concatenation) 함수를 적용하여 시스템 프롬프트를 생성할 수 있다.According to one embodiment, in step S230, the user terminal 110 inputs each element constituting the characteristic information as an argument of a predefined system prompt template and applies a concatenation function to the output value of the system prompt template. You can create a system prompt by doing this.

일 실시 예에 따르면, 사용자 단말(110)은 단계 S250에서, 제1 언어 모델의 출력에 제1 언어 모델에의 입력을 위해 정의된 프롬프트 정보 중 적어도 일부가 포함된 경우, 제1 언어 모델의 출력에 포함된 프롬프트 정보를 필터링할 수 있다. 예컨대, 사용자 단말(110)은 제1 언어 모델의 출력과 기 정의된 프롬프트 정보 사이의 유사도를 산출하여, 유사도가 임계 값 이상인 경우 제1 언어 모델의 출력 자체를 차단하거나, 제1 언어 모델의 출력에서 프롬프트 정보와 유사하다고 판단되는 일부분을 블락(block)하거나 다른 표현으로 대체할 수 있다.According to one embodiment, in step S250, when the output of the first language model includes at least some of the prompt information defined for input to the first language model, the user terminal 110 outputs the first language model. You can filter the prompt information contained in . For example, the user terminal 110 calculates the similarity between the output of the first language model and predefined prompt information, and if the similarity is greater than a threshold, blocks the output of the first language model itself or outputs the first language model. Parts that are judged to be similar to the prompt information can be blocked or replaced with other expressions.

다른 실시 예에 따르면, 사용자 단말(110)은 단계 S210 이후, 단계 S220을 수행하기에 앞서, 획득된 제1 쿼리에 기 정의된 프롬프트 관련 문자(예컨대, 프롬프트 공격에 자주 쓰이는 "system", "role", <>, [], {} 등)가 포함되어 있는지 판단하고, 프롬프트 관련 문자가 포함된 경우 제1 쿼리에 대한 응답을 생성하지 않을 수 있다. 이 경우, 사용자 단말(110)은 제1 쿼리에 대한 응답이 생성 불가함을 안내하는 메시지를 제공하거나, 다른 내용의 쿼리를 입력할 것을 요청하는 메시지를 제공할 수도 있다. 한편, 프롬프트 관련 문자가 정의된 데이터베이스는 사용자 단말(110) 또는 서버(120)에 저장될 수 있으며, 이에 한정되지는 않고 별도의 저장 매체에 저장될 수도 있다.According to another embodiment, the user terminal 110, after step S210 and before performing step S220, predefined prompt-related characters in the obtained first query (e.g., "system", "role", which are often used in prompt attacks). ", <>, [], {}, etc.) are included, and if prompt-related characters are included, a response to the first query may not be generated. In this case, the user terminal 110 may provide a message informing that a response to the first query cannot be generated, or may provide a message requesting that a query with different content be input. Meanwhile, the database in which prompt-related characters are defined may be stored in the user terminal 110 or the server 120, but is not limited to this and may be stored in a separate storage medium.

도 3 내지 도 6은 제1 실시 예와 관련된, 추가적인 챗봇 서비스 제공 방법의 흐름도이다. 설명의 편의를 위하여, 각 도면에서, 도 2의 방법을 구성하는 각 단계와 동일 또는 유사한 단계에 대해 중복되는 설명은 생략하기로 한다.3 to 6 are flowcharts of a method for providing additional chatbot services related to the first embodiment. For convenience of explanation, overlapping descriptions of steps identical or similar to each step constituting the method of FIG. 2 will be omitted in each drawing.

도 3은 대화 상대의 응답을 저장하는 실시 예를 설명한다. 사용자 단말(110)은 제1 언어 모델의 출력을 사용자의 제1 쿼리에 대한 대화 상대의 응답으로 제공하는 것과 별도로, 제1 언어 모델의 출력을 사용자 단말(110)의 랜덤 액세스 메모리에 저장할 수 있다(S360). 상술한 것처럼, 최근 N개의 대화 내용을 단기 기억 정보로 저장한다고 할 때, N을 최소로 설정하더라도 가장 최근의 대화(최근 생성된 대화 상대의 응답)를 저장할 필요가 있다. 아울러, 사용자 단말(110)은 제1 언어 모델의 출력을 랜덤 액세스 메모리에 저장함과 동시에, 랜덤 액세스 메모리에 기 저장되어 있던 N개의 대화 내용 중 가장 먼저 저장된 대화 내용을 삭제할 수 있다.Figure 3 explains an embodiment of storing a conversation partner's response. In addition to providing the output of the first language model as the conversation partner's response to the user's first query, the user terminal 110 may store the output of the first language model in the random access memory of the user terminal 110. (S360). As described above, when storing N recent conversation contents as short-term memory information, it is necessary to store the most recent conversation (response from the recently created conversation partner) even if N is set to the minimum. In addition, the user terminal 110 may store the output of the first language model in the random access memory and at the same time delete the first stored conversation content among the N conversation content previously stored in the random access memory.

도 4는 제1 쿼리에서 중장기적으로 저장할 필요가 있는 정보를 추출하여 저장하는 실시 예를 설명한다. 사용자 단말(110)은 제1 언어 모델을 이용하여 제1 쿼리에 대한 대화 상대의 응답을 제공하는 것과 별도로, 제1 쿼리로부터 사용자 단말(110)의 내장 메모리에 저장될 중장기 기억 정보를 추출하기 위해 제2 언어 모델에 제1 쿼리를 입력할 수 있다(S460). 이후, 사용자 단말(110)은 제2 언어 모델이 제1 쿼리에서 중장기 기억 정보를 추출하는 경우, 추출된 중장기 기억 정보를 사용자 단말(110)의 내장 메모리에 저장할 수 있다(S470). 즉 사용자가 입력한 하나의 쿼리(제1 쿼리)는 제1 언어 모델에 입력되어 대화 상대의 응답 생성 시 고려되는 동시에, 제2 언어 모델에 독립적으로 입력되어 이후의 대화에 고려될 중장기 기억 정보의 소스로 이용될 수도 있다. 제2 언어 모델은 도 2를 참조하여 중장기 기억 정보에 관해 상술한 바와 동일 내지 유사한 기능을 수행한다.Figure 4 explains an example of extracting and storing information that needs to be stored in the mid to long term from the first query. The user terminal 110 uses the first language model to extract mid- to long-term memory information to be stored in the internal memory of the user terminal 110 from the first query, in addition to providing the conversation partner's response to the first query. The first query may be input into the second language model (S460). Thereafter, when the second language model extracts mid- to long-term memory information from the first query, the user terminal 110 may store the extracted mid- to long-term memory information in the internal memory of the user terminal 110 (S470). In other words, one query (first query) entered by the user is input to the first language model and considered when generating the conversation partner's response, while at the same time being independently input to the second language model, it contains mid- to long-term memory information to be considered in subsequent conversations. It can also be used as a source. The second language model performs the same or similar functions as described above regarding mid- to long-term memory information with reference to FIG. 2.

도 5는 중장기적으로 저장된 정보를 삭제하는 실시 예를 설명한다. 사용자 단말(110)은 사용자로부터 사용자 단말(110)의 내장 메모리에 저장된 중장기 기억 정보 중 적어도 일부에 대한 삭제 요청을 수신할 수 있다(S560). 이후, 사용자 단말(110)은 삭제 요청에 해당하는 중장기 기억 정보를 사용자 단말(110)의 내장 메모리에서 삭제할 수 있다(S570). 사용자 단말(110)은 기 설정된 UI를 통해 어떠한 중장기 기억 정보가 내장 메모리에 저장되었는지 사용자에게 안내하고, 사용자로부터 삭제 요청을 수신할 수 있다. 예컨대, 사용자 단말(110)의 챗봇 서비스 애플리케이션 내 특정 페이지에서 중장기 기억 정보가 리스트 형태로 제공되고, 사용자가 이 중 특정 리스트 요소를 선택한 후 삭제 요청 아이콘을 누름으로써 선택된 중장기 기억 정보가 삭제될 수 있다. 다른 예로서, 사용자 단말(110)이 중장기 기억 정보를 저장할 때마다 푸시 알람 또는 팝업 메시지가 출력되고, 사용자는 특정한 푸시 알람이나 팝업 메시지를 선택하여 이동하는 페이지에서 해당 푸시 알람이나 팝업 메시지에 상응하는 중장기 기억 정보를 삭제 요청할 수도 있다. 다만, 중장기 기억 정보를 안내하고 삭제 요청을 수신하는 UI의 형태가 상기 언급한 형태로 한정되는 것은 아니다.Figure 5 explains an embodiment of deleting mid- to long-term stored information. The user terminal 110 may receive a request from the user to delete at least some of the mid- to long-term memory information stored in the internal memory of the user terminal 110 (S560). Thereafter, the user terminal 110 may delete the mid- to long-term memory information corresponding to the deletion request from the internal memory of the user terminal 110 (S570). The user terminal 110 may inform the user of what mid- to long-term memory information is stored in the internal memory through a preset UI and may receive a deletion request from the user. For example, mid- to long-term memory information is provided in the form of a list on a specific page within the chatbot service application of the user terminal 110, and the selected mid- to long-term memory information can be deleted by selecting a specific list element and pressing the deletion request icon. . As another example, whenever the user terminal 110 stores mid- to long-term memory information, a push alarm or pop-up message is output, and the user selects a specific push alarm or pop-up message and selects a specific push alarm or pop-up message corresponding to the push alarm or pop-up message on the moving page. You may also request deletion of mid- to long-term memory information. However, the form of the UI that guides mid- to long-term memory information and receives deletion requests is not limited to the forms mentioned above.

도 6은 사용자에게 대화 상대의 응답을 제공함에 따라 사용자의 챗봇 서비스 이용 상태를 갱신하는 실시 예를 설명한다. 사용자 단말(110)은 제1 언어 모델의 출력을 사용자의 제1 쿼리에 대한 대화 상대의 응답으로 제공함에 따라, 사용자의 과금 상태에 대응하는 챗봇 서비스 이용 가능 횟수를 갱신할 수 있다(S660).Figure 6 explains an embodiment of updating the user's chatbot service usage status as the conversation partner's response is provided to the user. The user terminal 110 may update the chatbot service availability count corresponding to the user's billing status by providing the output of the first language model as the conversation partner's response to the user's first query (S660).

챗봇 서비스의 과금 체계는 예시적으로, 이용 시간을 한정하거나, 대화 개수를 한정하는 형태로 설계될 수 있다. 만일 과금 체계가 사용자가 입력 가능한 대화(쿼리)의 개수를 한정하는 형태로 설계되었다면, 사용자 단말(110)은 사용자의 쿼리에 대한 응답이 제공된 경우 사용자가 1회의 대화 기회를 정당하게 사용한 것으로 간주하고, 사용자의 과금 상태를 고려한 최근의 '입력 가능한 대화의 개수'를 1회 차감할 수 있다. 대화 상대의 응답이 제공되었는지 여부를 갱신 기준으로 설정하는 것은, 사용자가 정상적인 응답을 획득하지 못했음에도 '입력 가능한 대화의 개수'를 차감하는 것은 부당하고, 잘못된 차감은 사용자 경험을 악화시킬 수 있다는 점을 고려한 것으로, 이러한 취지를 달성할 수 있는 범주 내에서 갱신 기준은 다양하게 설정될 수 있다.The charging system for chatbot services may be designed to limit usage time or limit the number of conversations. If the charging system is designed to limit the number of conversations (queries) that a user can input, the user terminal 110 will consider that the user has legitimately used one conversation opportunity when a response to the user's query is provided, and , the most recent ‘number of conversations that can be entered’ considering the user’s billing status can be deducted once. Setting whether or not the conversation partner's response was provided as an update standard is unfair to deduct the 'number of conversations that can be entered' even if the user did not obtain a normal response, and incorrect deduction can worsen the user experience. Considering this, renewal standards can be set in various ways within the scope that can achieve this purpose.

도 7은 제2 실시 예에 따른 챗봇 서비스 제공 방법의 흐름도이다.Figure 7 is a flowchart of a chatbot service provision method according to a second embodiment.

사용자 단말(110)은 특정 대화 상대에 대한 제1 쿼리를 획득할 수 있다(S710).The user terminal 110 may obtain a first query for a specific conversation partner (S710).

다음으로, 사용자 단말(110)은 사용자의 과금 상태에 기반하여, 현재 사용자의 챗봇 서비스 이용이 가능한지 판단할 수 있다(S720). 예컨대 사용자 단말(110)은 사용자의 과금 상태를 고려할 때 사용자의 대화 가능한 기간이 만료되었거나, 이용 가능한 모든 대화 개수를 소진하였을 시, 현재 사용자의 챗봇 서비스 이용이 불가한 것으로 판단할 수 있다.Next, the user terminal 110 may determine whether the user can currently use the chatbot service based on the user's billing status (S720). For example, considering the user's billing status, the user terminal 110 may determine that the user's chatbot service is currently unavailable when the user's conversation period has expired or all available conversation numbers have been exhausted.

판단 결과 사용자의 챗봇 서비스 이용이 가능한 경우, 사용자 단말(110)은 사용자, 대화 상대 또는 대화 상대와 사용자 사이의 대화 내용과 관련된 특성 정보를 로드하고(S730), 특성 정보에 대응하는 시스템 프롬프트를 생성하고(S740), 시스템 프롬프트 및 제1 쿼리에 대응하는 사용자 프롬프트를 제1 언어 모델에 입력하고(S750), 제1 언어 모델의 출력을 제1 쿼리에 대한 대화 상대의 응답으로 제공할 수 있다(S760). 한편 판단 결과 사용자의 챗봇 서비스 이용이 불가한 경우, 사용자 단말(110)은 제1 쿼리에 대한 응답을 출력할 수 없음을 안내하는 메시지를 제공할 수 있다(S770).As a result of the determination, if the user can use the chatbot service, the user terminal 110 loads characteristic information related to the user, the conversation partner, or the content of the conversation between the conversation partner and the user (S730), and generates a system prompt corresponding to the characteristic information. (S740), the system prompt and the user prompt corresponding to the first query are input into the first language model (S750), and the output of the first language model can be provided as the conversation partner's response to the first query (S750). S760). Meanwhile, if the user cannot use the chatbot service as a result of the determination, the user terminal 110 may provide a message informing that the response to the first query cannot be output (S770).

도 8은 제3 실시 예에 따른 챗봇 서비스 제공 방법의 흐름도이다.Figure 8 is a flowchart of a chatbot service provision method according to a third embodiment.

사용자 단말(110)은 특정 대화 상대에 대한 제1 쿼리를 획득할 수 있다(S810).The user terminal 110 may obtain a first query for a specific conversation partner (S810).

다음으로, 사용자 단말(110)은 제1 쿼리의 내용에 기반하여 제1 쿼리의 입력 가부를 판단할 수 있다(S820).Next, the user terminal 110 may determine whether to input the first query based on the contents of the first query (S820).

판단 결과 제1 쿼리의 입력이 가능한 경우, 사용자 단말(110)은 사용자, 대화 상대 또는 대화 상대와 사용자의 대화 내용과 관련된 특성 정보를 로드하고(S830), 로드된 특성 정보에 대응하는 시스템 프롬프트를 생성하고(S840), 시스템 프롬프트 및 제1 쿼리에 대응하는 사용자 프롬프트를 제1 언어 모델에 입력하고(S850), 제1 언어 모델의 출력을 제1 쿼리에 대한 대화 상대의 응답으로 제공할 수 있다(S860). 한편 판단 결과 제1 쿼리의 입력이 불가한 경우, 사용자 단말(110)은 제1 쿼리에 대한 응답을 출력할 수 없음을 안내하는 메시지를 제공할 수 있다(S870).As a result of the determination, if the first query can be input, the user terminal 110 loads characteristic information related to the user, a conversation partner, or the contents of the conversation between the user and the conversation partner (S830), and issues a system prompt corresponding to the loaded characteristic information. Generate (S840), input the system prompt and the user prompt corresponding to the first query into the first language model (S850), and provide the output of the first language model as the conversation partner's response to the first query. (S860). Meanwhile, if the determination results indicate that input of the first query is not possible, the user terminal 110 may provide a message informing that a response to the first query cannot be output (S870).

일 실시 예에 따르면, 사용자 단말(110)은 단계 S820에 있어서, 기 정의된 금칙어 데이터셋을 참조하여, 제1 쿼리에 금칙어 데이터셋에 포함된 금칙어가 포함된 경우 제1 쿼리를 입력 불가한 것으로 판단할 수 있다. 나아가, 사용자 단말(110)은 제1 쿼리에 금칙어 데이터셋에 포함된 금칙어와 일정 글자 수 이상 동일한 단어가 포함되어 있거나, 외부 사전(dictionary)을 기준으로 금칙어 데이터셋에 포함된 금칙어와 유의어에 해당하는 단어가 포함되어 있을 경우, 제1 쿼리를 입력 불가한 것으로 판단할 수도 있다. 도 8에 도시되지는 않았으나, 사용자 단말(110)은 제1 쿼리에 금칙어가 포함되어 있는 경우에는 해당 금칙어를 가림(block) 처리하거나 유의어로 대체하여 입력으로 사용할 수도 있다.According to one embodiment, in step S820, the user terminal 110 refers to a predefined prohibited word dataset and determines that the first query cannot be input if the first query includes a prohibited word included in the prohibited word dataset. You can judge. Furthermore, the user terminal 110 determines whether the first query contains a word that is the same as the banned word in the banned word dataset by a certain number of characters or more, or corresponds to a banned word and a synonym included in the banned word dataset based on an external dictionary. If a word is included, it may be determined that the first query cannot be entered. Although not shown in FIG. 8, if the first query includes a prohibited word, the user terminal 110 may block the prohibited word or replace it with a synonym and use it as an input.

다른 실시 예에 따르면, 사용자 단말(110)은 단계 S820에 있어서, 기 정의된 민감 데이터셋을 참조하여, 제1 쿼리에 대응되는 주제가 민감 데이터셋에 포함된 주제에 해당하는 경우 제1 쿼리를 입력 불가한 것으로 판단할 수도 있다. 예컨대, 사용자 단말(110)은 제1 쿼리에 포함된 키워드 중 적어도 일부에 기초하여 제1 쿼리의 주제를 식별하고, 식별된 주제가 민감 데이터셋에 포함된 주제 리스트에 존재하는지 확인할 수 있다. 식별된 주제가 민감 데이터셋에 포함된 주제 리스트에 존재한다면(예컨대, 정치, 젠더, 계급 등), 사용자 단말(110)은 제1 쿼리를 입력 불가한 것으로 판단할 수 있다.According to another embodiment, in step S820, the user terminal 110 refers to a predefined sensitive dataset and inputs the first query if the subject corresponding to the first query corresponds to a subject included in the sensitive dataset. It may be judged as impossible. For example, the user terminal 110 may identify the topic of the first query based on at least some of the keywords included in the first query and check whether the identified topic exists in the topic list included in the sensitive dataset. If the identified topic exists in the topic list included in the sensitive dataset (eg, politics, gender, class, etc.), the user terminal 110 may determine that the first query cannot be entered.

도 9는 챗봇 서비스 제공을 위한 전반적인 아키텍처의 일 예시이다.Figure 9 is an example of the overall architecture for providing chatbot services.

도시된 바와 같이, 사용자 단말(110)은 제1 쿼리가 입력됨에 따라 제1 언어 모델을 통해 대화 상대의 응답을 출력하여 사용자(client)에게 제공하고, 그와 별개로 대화 상대의 응답을 사용자 단말(110)의 RAM에 저장할 수 있다. 한편 사용자 단말(110)은 제1 쿼리가 입력됨에 따라 제2 언어 모델을 통해 제1 쿼리에서 추출할 중장기 기억 정보가 존재하는지 확인한 후, 존재할 경우 중장기 기억 정보를 추출하여 키-값 형식으로 내장 메모리에 저장하되, 그 중 보다 장기적으로 저장할 정보는 임베딩 벡터로 변환하여 내장 메모리에 저장할 수 있다.As shown, as the first query is input, the user terminal 110 outputs the conversation partner's response through the first language model and provides it to the user (client), and separately, the conversation partner's response is output to the user terminal. It can be stored in RAM at (110). Meanwhile, as the first query is input, the user terminal 110 checks whether mid- to long-term memory information to be extracted from the first query exists through the second language model, and if so, extracts the mid- to long-term memory information and formats it into the built-in memory in key-value format. However, information to be stored for a longer period of time can be converted to an embedding vector and stored in the internal memory.

또한, 사용자 단말(110)은 RAM에 저장된 단기 기억 정보와 내장 메모리에 저장된 중장기 기억 정보를 특성 정보에 반영하여, 이후 제2 쿼리가 입력될 시 제1 언어 모델을 통해 대화 상대의 응답을 출력함에 있어서 갱신된 특성 정보를 활용하도록 할 수 있다. 단기 기억 정보 및 중장기 기억 정보를 통한 특성 정보의 갱신 과정은 제1 쿼리와 제2 쿼리와의 관계에서만 수행되는 것은 아니며, 추후 제3 쿼리, 제4 쿼리 등 추가적인 쿼리가 입력되는 경우에도 마찬가지로 수행될 수 있다.In addition, the user terminal 110 reflects the short-term memory information stored in the RAM and the mid- to long-term memory information stored in the internal memory in the characteristic information, and then outputs the conversation partner's response through the first language model when the second query is input. This allows the updated characteristic information to be utilized. The process of updating characteristic information through short-term memory information and mid- to long-term memory information is not only performed in the relationship between the first query and the second query, and will also be performed similarly when additional queries such as the third query and fourth query are entered in the future. You can.

도 10은 제1 언어 모델을 통해 대화 상대의 응답을 출력하는 구체화된 아키텍처의 일 예시이다.Figure 10 is an example of a concrete architecture that outputs a conversation partner's response through a first language model.

도시된 바와 같이, 쿼리가 입력되면 기 정의된 사용자 프롬프트 형식에 맞게 사용자 프롬프트로 변환될 수 있다. 또한 쿼리를 고려하여 사용자 단말(110)의 RAM이나 내장 메모리로부터 단기 기억 정보 또는 중장기 기억 정보 중 적어도 일부를 포함하는 제3 특성 정보가 로드될 수 있고, 사용자 단말(110)이나 서버(120)로부터 사용자 관련 정보를 포함하는 제1 특성 정보, 페르소나 정보 또는 사실 관계 정보 중 적어도 일부를 포함하는 제2 특성 정보가 로드될 수 있으며, 로드된 특성 정보는 기 정의된 시스템 프롬프트 형식에 맞게 시스템 프롬프트로 변환될 수 있다.As shown, when a query is entered, it can be converted into a user prompt according to a predefined user prompt format. Additionally, in consideration of the query, third characteristic information including at least part of short-term memory information or mid- to long-term memory information may be loaded from the RAM or internal memory of the user terminal 110, and may be loaded from the user terminal 110 or the server 120. First characteristic information including user-related information, second characteristic information including at least part of persona information, or factual relationship information may be loaded, and the loaded characteristic information is converted into a system prompt to fit a predefined system prompt format. It can be.

제1 언어 모델은 시스템 프롬프트와 사용자 프롬프트를 입력으로 하여, 사용자가 선택한 대화 상대의 응답을 생성할 수 있다.The first language model can generate a response from a conversation partner selected by the user using a system prompt and a user prompt as input.

도 11a 및 도 11b는 챗봇 서비스가 적용된 애플리케이션에서 대화 상대를 선택하는 화면의 일 예시이다. 예시적으로, 해당 화면은 사용자 단말(110)의 출력 인터페이스를 통해 제공될 수 있다.Figures 11a and 11b are examples of screens for selecting a conversation partner in an application to which a chatbot service is applied. By way of example, the corresponding screen may be provided through the output interface of the user terminal 110.

도 11a의 화면은 사용자가 사전에 추가한 대화 상대의 프로필 리스트가 표시되는 화면으로, 사용자는 원하는 대화 상대와의 채팅 방을 개설하거나, 원치 않는 대화 상대의 프로필을 리스트에서 제외시킬 수 있다. 또한, 사용자는 대화 상대 별로 특정 키워드를 설정할 수 있으며, 설정된 키워드는 대화 상대의 응답 생성 시 로드되는 특성 정보를 결정하는 요소로 사용되거나, 대화 상대와 대화를 시작할 때 기본이 되는 대화 주제를 설정하는 요소로 사용될 수 있다.The screen in FIG. 11A is a screen that displays a profile list of conversation partners that the user has added in advance, and the user can open a chat room with desired conversation partners or exclude profiles of unwanted conversation partners from the list. In addition, users can set specific keywords for each conversation partner, and the set keywords are used as a factor to determine the characteristic information loaded when creating a response from a conversation partner, or to set the basic conversation topic when starting a conversation with a conversation partner. Can be used as an element.

도 11b의 화면은 사용자가 현재 대화 중인 채팅 방 리스트가 표시되는 화면으로, 각 채팅 방 리스트에는 대화 상대의 프로필 사진, 이름, 최근 대화 내용 또는 최근 대화 일시 중 적어도 일부가 표시될 수 있다. 사용자는 채팅 방 리스트 중 특정 채팅 방을 선택함으로써 해당 채팅 방에 입장할 수 있고, 입장한 채팅 방(대화 화면)에서 대화를 이어나갈 수 있다.The screen of FIG. 11B is a screen that displays a list of chat rooms in which the user is currently having a conversation. Each chat room list may display at least some of the conversation partner's profile picture, name, recent conversation content, or recent conversation date and time. The user can enter the chat room by selecting a specific chat room from the chat room list and continue the conversation in the entered chat room (conversation screen).

도 12a 및 도 12b는 챗봇 서비스가 적용된 애플리케이션 내 대화 화면의 일 예시이다. 예시적으로, 해당 화면은 사용자 단말(110)의 출력 인터페이스를 통해 제공될 수 있다.Figures 12a and 12b are examples of conversation screens within an application to which the chatbot service is applied. By way of example, the corresponding screen may be provided through the output interface of the user terminal 110.

도 12a에 도시된 대로, 사용자가 입력한 대화(쿼리)와 대화 상대의 응답은 일자 및 시간 순으로 정렬될 수 있으며, 각 대화(또는 응답) 주변에는 입력된 일시가 함께 표시될 수 있다. 또한, 대화 상대의 응답 주변에는 사운드 인터페이스가 표시될 수 있고, 사용자가 사운드 인터페이스를 선택 시 응답이 음성 출력 형태로 제공될 수 있다. 음성은 대화 상대 별로 설정될 수도 있고, 디폴트 음성으로 제공될 수도 있다.As shown in FIG. 12A, the conversation (query) entered by the user and the responses of the conversation partner can be sorted by date and time, and the date and time of the input may be displayed around each conversation (or response). Additionally, a sound interface may be displayed around the conversation partner's response, and when the user selects the sound interface, the response may be provided in the form of voice output. The voice may be set for each conversation partner, or may be provided as a default voice.

한편, 대화 화면에는 대화 상자의 뒷편으로 대화 상대가 2차원 또는 3차원으로 시각적으로 구현된 그래픽 오브젝트가 표시될 수도 있다. 해당 그래픽 오브젝트는 대화 내용에 따라 적응적으로 표정이나 포즈가 변경될 수 있다. 예시적으로, 도 12b에 도시된 대로 대화 내용 중 감정을 나타내는 단어(예컨대, '즐거워', '행복해' 등)가 포함된 경우, 그래픽 오브젝트는 해당 감정에 대응하여 설정된 포즈(예컨대, '하트 포즈')를 취할 수 있다.Meanwhile, on the conversation screen, a graphic object that visually represents the conversation partner in two or three dimensions may be displayed behind the dialog box. The graphic object may change its expression or pose adaptively depending on the conversation content. Exemplarily, as shown in FIG. 12b, when words representing emotions (e.g., 'happy', 'happy', etc.) are included in the conversation content, the graphic object displays a pose set corresponding to the emotion (e.g., 'heart pose') ') can be taken.

도 13은 일 실시 예에 따른 사용자 단말의 블록도를 나타낸다.Figure 13 shows a block diagram of a user terminal according to one embodiment.

사용자 단말(110)은 일 실시 예에 따라, 프로세서(111) 및 메모리(113)를 포함할 수 있다. 일 실시 예에서, 사용자 단말(110)은 입출력 인터페이스를 통하여 외부와 데이터를 교환할 수 있다.According to one embodiment, the user terminal 110 may include a processor 111 and a memory 113. In one embodiment, the user terminal 110 may exchange data with the outside world through an input/output interface.

프로세서(111)는 도 1 내지 도 12b를 통하여 전술한 적어도 하나의 방법을 수행할 수 있다. 메모리(113)는 도 1 내지 도 12b를 통하여 전술한 적어도 하나의 방법을 수행하기 위한 정보를 저장할 수 있다. 메모리(113)는 휘발성 메모리 또는 비휘발성 메모리일 수 있다.The processor 111 may perform at least one method described above through FIGS. 1 to 12B. The memory 113 may store information for performing at least one method described above with reference to FIGS. 1 to 12B. Memory 113 may be volatile memory or non-volatile memory.

프로세서(111)는 프로그램을 실행하고, 정보를 제공하기 위해 사용자 단말(110)을 제어할 수 있다. 프로세서(111)에 의하여 실행되는 프로그램의 코드는 메모리(113)에 저장될 수 있다.The processor 111 can control the user terminal 110 to execute programs and provide information. The code of the program executed by the processor 111 may be stored in the memory 113.

일 실시 예에서, 프로세서(111)는 메모리(113)와 연결되어, 사용자로부터 특정 대화 상대에 대한 제1 쿼리를 획득하고, 사용자, 대화 상대 또는 대화 상대와 사용자 사이의 대화 내용과 관련된 특성 정보를 로드하고, 특성 정보에 대응하는 시스템 프롬프트를 생성하고, 제1 쿼리에 대응하는 사용자 프롬프트 및 시스템 프롬프트를 제1 언어 모델에 입력하고, 제1 언어 모델의 출력을 제1 쿼리에 대한 대화 상대의 응답으로 제공할 수 있다.In one embodiment, the processor 111 is coupled with the memory 113 to obtain a first query for a specific conversation partner from the user and to obtain characteristic information related to the user, the conversation partner, or the content of the conversation between the conversation partner and the user. load, generate a system prompt corresponding to the feature information, input a user prompt and a system prompt corresponding to the first query into the first language model, and output the output of the first language model as the interlocutor's response to the first query. It can be provided as

또한 일 실시 예에 따른 사용자 단말(110)은 사용자 단말(110)의 사용자에게 정보를 제공할 수 있는 인터페이스를 더 포함할 수 있다.Additionally, the user terminal 110 according to one embodiment may further include an interface that can provide information to the user of the user terminal 110.

도 13에 도시된 사용자 단말(110)은 본 실시 예와 관련된 구성요소들만이 도시되어 있다. 따라서, 도 13에 도시된 구성요소들 외에 다른 범용적인 구성요소들이 더 포함될 수 있음을 본 실시 예와 관련된 기술분야에서 통상의 지식을 가진 자라면 이해할 수 있다.The user terminal 110 shown in FIG. 13 shows only components related to this embodiment. Accordingly, those skilled in the art can understand that other general-purpose components may be included in addition to the components shown in FIG. 13.

전술한 실시 예들에 따른 장치는 프로세서, 프로그램 데이터를 저장하고 실행하는 메모리, 디스크 드라이브와 같은 영구 저장부(permanent storage), 외부 장치와 통신하는 통신 포트, 터치 패널, 키(key), 버튼 등과 같은 사용자 인터페이스 장치 등을 포함할 수 있다. 소프트웨어 모듈 또는 알고리즘으로 구현되는 방법들은 상기 프로세서상에서 실행 가능한 컴퓨터가 읽을 수 있는 코드들 또는 프로그램 명령들로서 컴퓨터가 읽을 수 있는 기록 매체 상에 저장될 수 있다. 여기서 컴퓨터가 읽을 수 있는 기록 매체로 마그네틱 저장 매체(예컨대, ROM(read-only memory), RAM(random-Access memory), 플로피 디스크, 하드 디스크 등) 및 광학적 판독 매체(예컨대, 시디롬(CD-ROM), 디브이디(DVD: Digital Versatile Disc)) 등이 있다. 컴퓨터가 읽을 수 있는 기록 매체는 네트워크로 연결된 컴퓨터 시스템들에 분산되어, 분산 방식으로 컴퓨터가 판독 가능한 코드가 저장되고 실행될 수 있다. 매체는 컴퓨터에 의해 판독가능하며, 메모리에 저장되고, 프로세서에서 실행될 수 있다. Devices according to the above-described embodiments include a processor, memory for storing and executing program data, permanent storage such as a disk drive, a communication port for communicating with an external device, a touch panel, keys, buttons, etc. It may include a user interface device, etc. Methods implemented as software modules or algorithms may be stored on a computer-readable recording medium as computer-readable codes or program instructions executable on the processor. Here, computer-readable recording media include magnetic storage media (e.g., ROM (read-only memory), RAM (random-access memory), floppy disk, hard disk, etc.) and optical read media (e.g., CD-ROM). ), DVD (Digital Versatile Disc), etc. The computer-readable recording medium is distributed among computer systems connected to a network, so that computer-readable code can be stored and executed in a distributed manner. The media may be readable by a computer, stored in memory, and executed by a processor.

본 실시 예는 기능적인 블록 구성들 및 다양한 처리 단계들로 나타내어질 수 있다. 이러한 기능 블록들은 특정 기능들을 실행하는 다양한 개수의 하드웨어 또는/및 소프트웨어 구성들로 구현될 수 있다. 예를 들어, 실시 예는 하나 이상의 마이크로프로세서들의 제어 또는 다른 제어 장치들에 의해서 다양한 기능들을 실행할 수 있는, 메모리, 프로세싱, 로직(logic), 룩 업 테이블(look-up table) 등과 같은 직접 회로 구성들을 채용할 수 있다. 구성 요소들이 소프트웨어 프로그래밍 또는 소프트웨어 요소들로 실행될 수 있는 것과 유사하게, 본 실시 예는 데이터 구조, 프로세스들, 루틴들 또는 다른 프로그래밍 구성들의 조합으로 구현되는 다양한 알고리즘을 포함하여, C, C++, 자바(Java), 어셈블러(assembler) 등과 같은 프로그래밍 또는 스크립팅 언어로 구현될 수 있다. 기능적인 측면들은 하나 이상의 프로세서들에서 실행되는 알고리즘으로 구현될 수 있다. 또한, 본 실시 예는 전자적인 환경 설정, 신호 처리, 메시지 처리, 및/또는 데이터 처리 등을 위하여 종래 기술을 채용할 수 있다. “매커니즘”, “요소”, “수단”, “구성”과 같은 용어는 넓게 사용될 수 있으며, 기계적이고 물리적인 구성들로서 한정되는 것은 아니다. 상기 용어는 프로세서 등과 연계하여 소프트웨어의 일련의 처리들(routines)의 의미를 포함할 수 있다.This embodiment can be represented by functional block configurations and various processing steps. These functional blocks may be implemented in various numbers of hardware or/and software configurations that execute specific functions. For example, embodiments include integrated circuit configurations such as memory, processing, logic, look-up tables, etc. that can execute various functions under the control of one or more microprocessors or other control devices. can be hired. Similar to how the components can be implemented as software programming or software elements, the present embodiments include various algorithms implemented as combinations of data structures, processes, routines or other programming constructs, such as C, C++, Java ( It can be implemented in a programming or scripting language such as Java), assembler, etc. Functional aspects may be implemented as algorithms running on one or more processors. Additionally, this embodiment may employ conventional technologies for electronic environment setting, signal processing, message processing, and/or data processing. Terms such as “mechanism,” “element,” “means,” and “composition” can be used broadly and are not limited to mechanical and physical components. The term may include the meaning of a series of software routines in connection with a processor, etc.

전술한 실시 예들은 일 예시일 뿐 후술하는 청구항들의 범위 내에서 다른 실시 예들이 구현될 수 있다.The above-described embodiments are merely examples and other embodiments may be implemented within the scope of the claims described below.

Claims (20)

사용자 단말에서 수행되는 챗봇 서비스 제공 방법에 있어서,
사용자로부터 특정 대화 상대에 대한 제1 쿼리를 획득하는 단계;
상기 사용자, 상기 대화 상대 또는 상기 대화 상대와 상기 사용자 사이의 대화 내용과 관련된 특성 정보를 로드하는 단계;
상기 제1 쿼리에 대응하는 사용자 프롬프트를 생성하는 단계;
상기 특성 정보에 대응하는 시스템 프롬프트를 생성하는 단계;
상기 사용자 프롬프트 및 상기 시스템 프롬프트를 각각 제1 언어 모델에 입력하는 단계;
상기 사용자 프롬프트 및 상기 시스템 프롬프트에 기반한 상기 제1 언어 모델의 출력을 상기 제1 쿼리에 대한 상기 대화 상대의 응답으로 제공하는 단계;
상기 제1 언어 모델의 출력을 상기 사용자 단말의 랜덤 액세스 메모리에 저장하는 단계;
상기 사용자 단말의 내장 메모리에 저장될 중장기 기억 정보를 추출하기 위한 제2 언어 모델에 상기 제1 쿼리를 입력하는 단계; 및
상기 제2 언어 모델이 상기 제1 쿼리에서 중장기 기억 정보를 추출하는 경우, 상기 추출된 중장기 기억 정보를 상기 내장 메모리에 저장하는 단계
를 포함하는, 챗봇 서비스 제공 방법.
In the method of providing chatbot services performed on a user terminal,
Obtaining a first query for a specific conversation partner from the user;
loading characteristic information related to the user, the conversation partner, or content of a conversation between the conversation partner and the user;
generating a user prompt corresponding to the first query;
generating a system prompt corresponding to the characteristic information;
inputting the user prompt and the system prompt into a first language model, respectively;
providing an output of the first language model based on the user prompt and the system prompt as the conversation partner's response to the first query;
storing the output of the first language model in a random access memory of the user terminal;
Inputting the first query into a second language model for extracting mid- to long-term memory information to be stored in the internal memory of the user terminal; and
When the second language model extracts mid- to long-term memory information from the first query, storing the extracted mid- to long-term memory information in the internal memory.
A method of providing chatbot services, including.
제1 항에 있어서,
상기 특성 정보는,
상기 사용자와 관련된 제1 특성 정보를 포함하고,
상기 제1 특성 정보는,
상기 사용자의 챗봇 서비스 회원가입 시 수집된 정보를 포함하는, 챗봇 서비스 제공 방법.
According to claim 1,
The above characteristic information is,
Contains first characteristic information related to the user,
The first characteristic information is,
A method of providing a chatbot service, including information collected when the user signs up for chatbot service membership.
제1 항에 있어서,
상기 특성 정보는,
상기 대화 상대와 관련된 제2 특성 정보를 포함하고,
상기 제2 특성 정보는,
상기 대화 상대의 대화 스타일 데이터를 포함하는 페르소나 정보 및 상기 대화 상대의 사실 관계 정보를 포함하는, 챗봇 서비스 제공 방법.
According to claim 1,
The above characteristic information is,
Contains second characteristic information related to the conversation partner,
The second characteristic information is,
A method of providing a chatbot service, including persona information including conversation style data of the conversation partner and factual relationship information of the conversation partner.
제3 항에 있어서,
상기 사실 관계 정보는,
상기 대화 상대의 사실 관계에 대응하는 복수의 임베딩 벡터 중 상기 제1 쿼리와의 유사도가 임계 값 이상인 임베딩 벡터를 포함하는, 챗봇 서비스 제공 방법.
According to clause 3,
The above factual information is,
A method of providing a chatbot service, including an embedding vector whose similarity to the first query is greater than or equal to a threshold value among a plurality of embedding vectors corresponding to the factual relationship of the conversation partner.
제1 항에 있어서,
상기 특성 정보는,
상기 대화 상대와 관련된 제2 특성 정보를 포함하고,
상기 제2 특성 정보는,
웹 크롤링(Web Crawling)을 통해 수집되거나, 기 설정된 협약 조건에 따라 상기 대화 상대의 매니지먼트 서버로부터 전송되는, 챗봇 서비스 제공 방법.
According to claim 1,
The above characteristic information is,
Contains second characteristic information related to the conversation partner,
The second characteristic information is,
A method of providing a chatbot service that is collected through web crawling or transmitted from the management server of the conversation partner according to preset agreement conditions.
제1 항에 있어서,
상기 특성 정보는,
상기 대화 내용과 관련된 제3 특성 정보를 포함하고,
상기 제3 특성 정보는,
상기 대화 내용 중 상기 사용자 단말의 내장 메모리에 추출되어 저장된 중장기 기억 정보 및 상기 대화 내용 중 상기 사용자 단말의 랜덤 액세스 메모리(Random Access Memory, RAM)에 저장된 단기 기억 정보를 포함하는, 챗봇 서비스 제공 방법.
According to claim 1,
The above characteristic information is,
Contains third characteristic information related to the conversation content,
The third characteristic information is,
A chatbot service providing method comprising mid- to long-term memory information extracted and stored in the internal memory of the user terminal among the conversation content and short-term memory information stored in the random access memory (RAM) of the user terminal among the conversation content.
제6 항에 있어서,
상기 중장기 기억 정보는,
JavaScript Object Notation(JSON) 파일 형식으로 저장되는 제1 중장기 기억 정보 및 임베딩 벡터로 변환되어 바이너리(BIN) 파일 형식으로 저장되는 제2 중장기 기억 정보를 포함하는, 챗봇 서비스 제공 방법.
According to clause 6,
The mid- to long-term memory information is,
A method of providing a chatbot service, including first mid- to long-term memory information stored in a JavaScript Object Notation (JSON) file format and second mid- to long-term memory information converted to an embedding vector and stored in a binary (BIN) file format.
제1 항에 있어서,
상기 특성 정보는,
상기 대화 내용과 관련된 제3 특성 정보를 포함하고,
상기 제3 특성 정보는,
상기 대화 내용 중 상기 사용자의 입력의 적어도 일부가 추출되어 저장된 중장기 기억 정보 및 상기 대화 내용 중 최근 N개(단, N은 자연수)의 대화 내용이 저장된 단기 기억 정보를 포함하는, 챗봇 서비스 제공 방법.
According to claim 1,
The above characteristic information is,
Contains third characteristic information related to the conversation content,
The third characteristic information is,
A method of providing a chatbot service, including mid- to long-term memory information in which at least a portion of the user's input is extracted and stored among the conversation content, and short-term memory information in which the most recent N conversations (where N is a natural number) among the conversation content are stored.
제1 항에 있어서,
상기 시스템 프롬프트를 생성하는 단계는,
상기 특성 정보를 구성하는 요소 각각을 기 정의된 시스템 프롬프트 템플릿의 인자로 입력하는 단계; 및
상기 시스템 프롬프트 템플릿의 출력 값에 순차(concatenation) 함수를 적용하여 상기 시스템 프롬프트를 생성하는 단계를 포함하는, 챗봇 서비스 제공 방법.
According to claim 1,
The step of creating the system prompt is,
Inputting each element constituting the characteristic information as an argument of a predefined system prompt template; and
A chatbot service providing method comprising generating the system prompt by applying a concatenation function to the output value of the system prompt template.
삭제delete 삭제delete 제1 항에 있어서,
상기 사용자로부터 상기 사용자 단말의 내장 메모리에 저장된 중장기 기억 정보 중 적어도 일부에 대한 삭제 요청을 수신하는 단계; 및
상기 삭제 요청에 해당하는 상기 중장기 기억 정보를 상기 내장 메모리에서 삭제하는 단계를 더 포함하는, 챗봇 서비스 제공 방법.
According to claim 1,
Receiving a request for deletion of at least some of the mid- to long-term memory information stored in the internal memory of the user terminal from the user; and
A method of providing a chatbot service, further comprising deleting the mid- to long-term memory information corresponding to the deletion request from the internal memory.
제1 항에 있어서,
상기 제공하는 단계는,
상기 제1 언어 모델의 출력에 상기 제1 언어 모델에의 입력을 위해 정의된 프롬프트 정보 중 적어도 일부가 포함된 경우, 상기 제1 언어 모델의 출력에 포함된 프롬프트 정보를 필터링하는 단계를 포함하는, 챗봇 서비스 제공 방법.
According to claim 1,
The steps provided above are:
When the output of the first language model includes at least some of the prompt information defined for input to the first language model, filtering the prompt information included in the output of the first language model, How to provide chatbot services.
제1 항에 있어서,
상기 제1 언어 모델의 출력을 상기 대화 상대의 응답으로 제공함에 따라, 상기 사용자의 과금 상태에 대응하는 챗봇 서비스 이용 가능 횟수를 갱신하는 단계를 더 포함하는, 챗봇 서비스 제공 방법.
According to claim 1,
A method of providing a chatbot service, further comprising updating the number of times a chatbot service can be used corresponding to the user's billing status by providing the output of the first language model as a response from the interlocutor.
사용자 단말에서 수행되는 챗봇 서비스 제공 방법에 있어서,
사용자로부터 특정 대화 상대에 대한 제1 쿼리를 획득하는 단계;
상기 사용자의 과금 상태에 기반하여, 현재 상기 사용자의 챗봇 서비스 이용이 가능한지 판단하는 단계;
상기 사용자의 챗봇 서비스 이용이 불가한 경우, 상기 제1 쿼리에 대한 응답을 출력할 수 없음을 안내하는 메시지를 제공하는 단계;
상기 사용자의 챗봇 서비스 이용이 가능한 경우:
상기 제1 쿼리에 대응하는 사용자 프롬프트를 생성하는 단계;
상기 사용자, 상기 대화 상대 또는 상기 대화 상대와 상기 사용자 사이의 대화 내용과 관련된 특성 정보를 로드하는 단계;
상기 특성 정보에 대응하는 시스템 프롬프트를 생성하는 단계;
상기 사용자 프롬프트 및 상기 시스템 프롬프트를 각각 제1 언어 모델에 입력하는 단계;
상기 사용자 프롬프트 및 상기 시스템 프롬프트에 기반한 상기 제1 언어 모델의 출력을 상기 제1 쿼리에 대한 상기 대화 상대의 응답으로 제공하는 단계;
상기 제1 언어 모델의 출력을 상기 사용자 단말의 랜덤 액세스 메모리에 저장하는 단계;
상기 사용자 단말의 내장 메모리에 저장될 중장기 기억 정보를 추출하기 위한 제2 언어 모델에 상기 제1 쿼리를 입력하는 단계; 및
상기 제2 언어 모델이 상기 제1 쿼리에서 중장기 기억 정보를 추출하는 경우, 상기 추출된 중장기 기억 정보를 상기 내장 메모리에 저장하는 단계
를 포함하는, 챗봇 서비스 제공 방법.
In the method of providing chatbot services performed on a user terminal,
Obtaining a first query for a specific conversation partner from the user;
Based on the user's billing status, determining whether the user can currently use the chatbot service;
If the user is unable to use the chatbot service, providing a message informing that a response to the first query cannot be output;
When the above user can use the chatbot service:
generating a user prompt corresponding to the first query;
loading characteristic information related to the user, the conversation partner, or content of a conversation between the conversation partner and the user;
generating a system prompt corresponding to the characteristic information;
inputting the user prompt and the system prompt into a first language model, respectively;
providing an output of the first language model based on the user prompt and the system prompt as the conversation partner's response to the first query;
storing the output of the first language model in a random access memory of the user terminal;
Inputting the first query into a second language model for extracting mid- to long-term memory information to be stored in the internal memory of the user terminal; and
When the second language model extracts mid- to long-term memory information from the first query, storing the extracted mid- to long-term memory information in the internal memory.
A method of providing chatbot services, including.
사용자 단말에서 수행되는 챗봇 서비스 제공 방법에 있어서,
사용자로부터 특정 대화 상대에 대한 제1 쿼리를 획득하는 단계;
상기 제1 쿼리의 내용에 기반하여 상기 제1 쿼리의 입력 가부를 판단하는 단계;
상기 제1 쿼리가 입력 불가한 것으로 판단되는 경우, 상기 제1 쿼리에 대한 응답을 출력할 수 없음을 안내하는 메시지를 제공하는 단계;
상기 제1 쿼리가 입력 가능한 것으로 판단되는 경우:
상기 제1 쿼리에 대응하는 사용자 프롬프트를 생성하는 단계;
상기 사용자, 상기 대화 상대 또는 상기 대화 상대와 상기 사용자의 대화 내용과 관련된 특성 정보를 로드하는 단계;
상기 특성 정보에 대응하는 시스템 프롬프트를 생성하는 단계;
상기 사용자 프롬프트 및 상기 시스템 프롬프트를 각각 제1 언어 모델에 입력하는 단계;
상기 사용자 프롬프트 및 상기 시스템 프롬프트에 기반한 상기 제1 언어 모델의 출력을 상기 제1 쿼리에 대한 상기 대화 상대의 응답으로 제공하는 단계;
상기 제1 언어 모델의 출력을 상기 사용자 단말의 랜덤 액세스 메모리에 저장하는 단계;
상기 사용자 단말의 내장 메모리에 저장될 중장기 기억 정보를 추출하기 위한 제2 언어 모델에 상기 제1 쿼리를 입력하는 단계; 및
상기 제2 언어 모델이 상기 제1 쿼리에서 중장기 기억 정보를 추출하는 경우, 상기 추출된 중장기 기억 정보를 상기 내장 메모리에 저장하는 단계
를 포함하는, 챗봇 서비스 제공 방법.
In the method of providing chatbot services performed on a user terminal,
Obtaining a first query for a specific conversation partner from the user;
determining whether to input the first query based on the contents of the first query;
If it is determined that the first query cannot be input, providing a message informing that a response to the first query cannot be output;
If the first query is determined to be inputable:
generating a user prompt corresponding to the first query;
Loading characteristic information related to the user, the conversation partner, or contents of a conversation between the conversation partner and the user;
generating a system prompt corresponding to the characteristic information;
inputting the user prompt and the system prompt into a first language model, respectively;
providing an output of the first language model based on the user prompt and the system prompt as the conversation partner's response to the first query;
storing the output of the first language model in a random access memory of the user terminal;
Inputting the first query into a second language model for extracting mid- to long-term memory information to be stored in the internal memory of the user terminal; and
When the second language model extracts mid- to long-term memory information from the first query, storing the extracted mid- to long-term memory information in the internal memory.
A method of providing chatbot services, including.
제16 항에 있어서,
상기 제1 쿼리의 입력 가부를 판단하는 단계는,
기 정의된 금칙어 데이터셋을 참조하여, 상기 제1 쿼리에 상기 금칙어 데이터셋에 포함된 금칙어가 포함된 경우 상기 제1 쿼리를 입력 불가한 것으로 판단하는 단계를 포함하는, 챗봇 서비스 제공 방법.
According to claim 16,
The step of determining whether to input the first query is:
A method of providing a chatbot service, including the step of determining that the first query cannot be input when the first query includes a prohibited word included in the banned word dataset, with reference to a predefined banned word dataset.
제16 항에 있어서,
상기 제1 쿼리의 입력 가부를 판단하는 단계는,
기 정의된 민감 데이터셋을 참조하여, 상기 제1 쿼리에 대응되는 주제가 상기 민감 데이터셋에 포함된 주제에 해당하는 경우 상기 제1 쿼리를 입력 불가한 것으로 판단하는 단계를 포함하는, 챗봇 서비스 제공 방법.
According to claim 16,
The step of determining whether to input the first query is:
A method of providing a chatbot service, including the step of determining that the first query cannot be entered if the topic corresponding to the first query corresponds to a topic included in the sensitive data set, with reference to a predefined sensitive data set. .
제1 항 내지 제9 항, 제12 항 내지 제18 항 중 어느 한 항에 따른 방법을 수행하기 위한 프로그램이 기록된, 컴퓨터 판독 가능한 기록 매체.A computer-readable recording medium on which a program for performing the method according to any one of claims 1 to 9 and 12 to 18 is recorded. 챗봇 서비스를 제공하는 사용자 단말에 있어서,
하나 이상의 프로세서; 및
상기 하나 이상의 프로세서에 의해 실행되는 하나 이상의 명령을 저장하는 메모리를 포함하고,
상기 하나 이상의 프로세서는, 상기 하나 이상의 명령을 실행함으로써,
사용자로부터 특정 대화 상대에 대한 제1 쿼리를 획득하고,
상기 제1 쿼리에 대응하는 사용자 프롬프트를 생성하고,
상기 사용자, 상기 대화 상대 또는 상기 대화 상대와 상기 사용자 사이의 대화 내용과 관련된 특성 정보를 로드하고,
상기 특성 정보에 대응하는 시스템 프롬프트를 생성하고,
상기 사용자 프롬프트 및 상기 시스템 프롬프트를 각각 제1 언어 모델에 입력하고,
상기 사용자 프롬프트 및 상기 시스템 프롬프트에 기반한 상기 제1 언어 모델의 출력을 상기 제1 쿼리에 대한 상기 대화 상대의 응답으로 제공하고,
상기 제1 언어 모델의 출력을 상기 사용자 단말의 랜덤 액세스 메모리에 저장하고,
상기 사용자 단말의 내장 메모리에 저장될 중장기 기억 정보를 추출하기 위한 제2 언어 모델에 상기 제1 쿼리를 입력하고,
상기 제2 언어 모델이 상기 제1 쿼리에서 중장기 기억 정보를 추출하는 경우, 상기 추출된 중장기 기억 정보를 상기 내장 메모리에 저장하는, 사용자 단말.
In a user terminal that provides a chatbot service,
One or more processors; and
a memory that stores one or more instructions to be executed by the one or more processors;
The one or more processors execute the one or more instructions,
obtain a first query from the user about a specific conversation partner;
generate a user prompt corresponding to the first query,
Load characteristic information related to the user, the conversation partner, or the contents of a conversation between the conversation partner and the user,
Generate a system prompt corresponding to the characteristic information,
inputting the user prompt and the system prompt into a first language model, respectively;
providing an output of the first language model based on the user prompt and the system prompt as the conversation partner's response to the first query;
Store the output of the first language model in a random access memory of the user terminal,
Entering the first query into a second language model for extracting mid- to long-term memory information to be stored in the internal memory of the user terminal,
When the second language model extracts mid- to long-term memory information from the first query, the user terminal stores the extracted mid- to long-term memory information in the internal memory.
KR1020230178571A 2023-12-11 2023-12-11 Method for providing chat-bot service and user terminal therefor KR102642981B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020230178571A KR102642981B1 (en) 2023-12-11 2023-12-11 Method for providing chat-bot service and user terminal therefor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020230178571A KR102642981B1 (en) 2023-12-11 2023-12-11 Method for providing chat-bot service and user terminal therefor

Publications (1)

Publication Number Publication Date
KR102642981B1 true KR102642981B1 (en) 2024-03-05

Family

ID=90298030

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020230178571A KR102642981B1 (en) 2023-12-11 2023-12-11 Method for providing chat-bot service and user terminal therefor

Country Status (1)

Country Link
KR (1) KR102642981B1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20210000624A (en) * 2019-06-25 2021-01-05 (주) 엠투유테크널러지 Apparatus for matching chatbot communication pattern
KR20220022726A (en) * 2020-08-19 2022-02-28 삼성전자주식회사 Method and apparatus for training embedding vector generation model
KR20220158573A (en) * 2021-05-24 2022-12-01 네이버 주식회사 Method and system for controlling for persona chatbot
KR20230052545A (en) * 2021-10-13 2023-04-20 심심이(주) Server and method for providing communication service
US20230274086A1 (en) * 2021-08-24 2023-08-31 Unlikely Artificial Intelligence Limited Computer implemented methods for the automated analysis or use of data, including use of a large language model

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20210000624A (en) * 2019-06-25 2021-01-05 (주) 엠투유테크널러지 Apparatus for matching chatbot communication pattern
KR20220022726A (en) * 2020-08-19 2022-02-28 삼성전자주식회사 Method and apparatus for training embedding vector generation model
KR20220158573A (en) * 2021-05-24 2022-12-01 네이버 주식회사 Method and system for controlling for persona chatbot
US20230274086A1 (en) * 2021-08-24 2023-08-31 Unlikely Artificial Intelligence Limited Computer implemented methods for the automated analysis or use of data, including use of a large language model
KR20230052545A (en) * 2021-10-13 2023-04-20 심심이(주) Server and method for providing communication service

Similar Documents

Publication Publication Date Title
CN110710170B (en) Proactive provision of new content to group chat participants
US11252117B2 (en) Electronic communication message coaching service
US10552218B2 (en) Dynamic context of tasks
WO2017217507A1 (en) Artificial intelligence system for supporting communication
CN102750270B (en) The dialogue of expansion understands agency
US10922360B2 (en) Ancillary speech generation via query answering in knowledge graphs
Khan et al. Introduction to chatbots
US11087414B2 (en) Distance-based social message pruning
WO2019112821A1 (en) Content based transformation for digital documents
US20200226216A1 (en) Context-sensitive summarization
CN104731842A (en) Mapping relationships using electronic communications data
US11586689B2 (en) Electronic apparatus and controlling method thereof
US20210141820A1 (en) Omnichannel virtual assistant using artificial intelligence
US11144560B2 (en) Utilizing unsumbitted user input data for improved task performance
US11095601B1 (en) Connection tier structure defining for control of multi-tier propagation of social network content
Zamani et al. Generative mechanisms of workarounds, discontinuance and reframing: a study of negative disconfirmation with consumerised IT
US11429833B2 (en) Cognitive communication assistant services
CN109299375A (en) Information personalized push method, device, electronic equipment and storage medium
CN111316276A (en) Using distributed state machines with automated assistants for human-machine conversation to protect private data
Castillejo et al. Ontology-based model for supporting dynamic and adaptive user interfaces
EP4060517A1 (en) System and method for designing artificial intelligence (ai) based hierarchical multi-conversation system
Kekolahti et al. The effect of an individual’s age on the perceived importance and usage intensity of communications services—A Bayesian Network analysis
Jandrić et al. Postdigital Citizen Science: Mapping the Field
KR102642981B1 (en) Method for providing chat-bot service and user terminal therefor
TWI818695B (en) Computer-implemented method, computer program product, and computer system for counterfactual conversation simulation

Legal Events

Date Code Title Description
E701 Decision to grant or registration of patent right
GRNT Written decision to grant