Method for protecting personal data of a user for a chatbot and electronic system thereof
The method masks personal data in chatbot inputs with anonymous labels to maintain response quality and privacy, allowing accurate chatbot responses while protecting user data.
Patent Information
- Application Number
- PCT/IB2024/053831
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-04-20
- Filing Date
- 2024-04-19
- Publication Date
- 2024-10-24
AI Technical Summary
Existing methods for protecting personal data in chatbots either delete or substitute sensitive information, leading to poor response quality from the chatbot, as they prevent personal data from being processed in plain text.
A method that masks personal data in natural language text messages by substituting it with anonymous labels, allowing the chatbot to interpret and respond accurately, while maintaining context, and later replacing these labels with the original data externally.
Effectively protects personal data from being received in plain text by chatbots, enabling them to generate high-quality responses while ensuring data privacy compliance.
Smart Images

Figure IB2024053831_24102024_PF_FP_ABST
Abstract
Description
[0001] METHOD FOR PROTECTING PERSONAL DATA OF A USER FOR A CHATBOT
[0002] AND ELECTRONIC SYSTEM THEREOF
[0003] DESCRIPTION
[0004] TECHNICAL FIELD OF THE INVENTION
[0005] The present invention generally relates to the field of chatbots.
[0006] More in particular, the present invention concerns a method for protecting personal data that a chatbot or Large Language Model could receive as input.
[0007] PRIOR ART
[0008] A chatbot is a software application used to conduct in real time a conversation in natural language with a human subject.
[0009] The chatbot is able to understand the intent of the human subject and to answer their questions.
[0010] The chatbot can work by using a set of rules predefined by the programmer, or it can use artificial intelligence techniques that allow it to further improve its operation by using the new data it receives as input.
[0011] ChatGPT is a well-known chatbot developed by OpenAI using artificial intelligence techniques, in particular machine learning and a Large Language Model (LLM).
[0012] It is important to protect the personal data of users such as for example telephone number, e-mail address, tax code and payment data (number of the credit card, bank account number), as personal data could be used by attackers to carry out scams.
[0013] The Applicant has observed that it is possible for a human subject to provide personal data to a chatbot or to a Large Language Model, which could then provide them to other users without having obtained the owner's authorization, thus violating data protection laws, such as for example the General Data Protection Regulation (so- called GDPR) of the European Union no. 2016 / 679; in addition, there is a risk that the personal data of a user may be provided by the chatbot to another user who might use it fraudulently.
[0014] Solutions are known in which the personal data are deleted before being sent as input to the chatbot or solutions in which the personal data are substituted with other data: these solutions have the disadvantage of not allowing the chatbot to generate good quality responses, due to the lack of the personal data in the text they receive as input.
[0015] It is therefore necessary to prevent personal data from being provided in plain text as input to the chatbot for processing, while at the same time allowing the chatbot to generate a good quality, i.e. accurate, response as output.
[0016] US 2021 / 334455 A1 discloses identifying sensitive data in a text, in particular direct identifiers allowing by themselves to identify an individual (e.g. the name of a person, their telephone number, the number of a credit card, IP address of a computer) and indirect identifiers which can identify an individual only if combined with at least another indirect identifier (e.g. date of birth or age, gender, postal code).
[0017] US 2021 / 334455 A1 discloses substituting identifiers (directly or indirectly identified) with a respective anonymous value or label indicating the type of data substituted, such as for example the NAME value substituting the name and surname of a person and the GENDER value substituting the sex of a person: in this way an anonymous text is generated that can be used by third parties (for example, an anonymized text of a patient can be used to support medical studies).
[0018] EP 3726414 A1 discloses substituting sensitive data of a text with natural pseudonyms, so that the pseudonym is not distinguishable from the substituted sensitive data and has at least one same information attribute in common.
[0019] SUMMARY OF THE INVENTION
[0020] The present invention relates to a computer-implemented method for protecting personal data for a chatbot as defined in the appended claim 1 and the preferred embodiments thereof described in the dependent claims from 2 to 10.
[0021] The Applicant has perceived that the method for protecting personal data in accordance with the present invention can effectively protect the personal data of a user, preventing them from being received in plain text by a chatbot, while at the same time allowing the chatbot to generate good quality responses.
[0022] The basic idea is to mask the personal data contained in a text message in natural language, substituting the personal data with the appropriate anonymous labels (i.e. that do not contain the personal data in plain text, for example, an address, a telephone number, a number of credit card), in which said anonymous labels are correlated to the personal data that has been substituted: in this way the consistency and comprehensibility of the anonymized text message generated in natural language is maintained and thus the chatbot or the Large Language Model is able to correctly interpret the context of the anonymized text message in natural language received as input and thus it is able to process it correctly (even if the Large Language Model has not been trained to respond to an anonymized text), generating as output an accurate response comprising a text message in natural language comprising one or more of the anonymous labels contained in the input text message. Finally, the anonymous labels of the output text message are substituted (externally to the chatbot or Large Language Model) with the respective personal data.
[0023] It is also an object of the present invention a non-transitory computer-readable storage medium as defined in the appended claim 9.
[0024] It is also an object of the present invention a computer program comprising software code portions adapted to perform the steps of the method for protecting personal data according to the invention, when said program is run on at least one computer.
[0025] It is also an object of the present invention an electronic system for protecting personal data, wherein the electronic system is defined in the appended claim 12 and by a preferred embodiment thereof described in the appended claim 13.
[0026] It is also an object of the present invention a chatbot as defined in the appended claim 14.
[0027] It is also an object of the present invention a Large Language Model as defined in the appended claim 15.
[0028] BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Further features and advantages of the invention will become more apparent from the description which follows of a preferred embodiment and the variants thereof, provided by way of example with reference to the appended drawings, in which:
[0030] Figure 1 shows a block diagram of an electronic system for interaction between a human subject and a chatbot by means of natural language according to an embodiment of the invention.
[0031] DETAILED DESCRIPTION OF THE INVENTION
[0032] It should be observed that, in the following description, identical or analogous blocks, components or modules are indicated in the figures with the same numerical references, even if they are shown in different embodiments of the invention.
[0033] With reference to Figure 1 , a block diagram of an electronic system 1 for the interaction between a human subject and a chatbot 3 by means of natural language is shown. The electronic system 1 comprises a sub-system 5 for protecting personal data of the human subject and comprises the chatbot 3 interacting with the human subject by means of a text message in natural language.
[0034] The text message may be generated directly by the human subject or by means of speech-to-text conversion of a voice message pronounced by the human subject.
[0035] Alternatively, the text message may be generated by means of text documents selected by the human subject.
[0036] The chatbot 3 is realized by means of a software program executed on a processor, such as for example a microprocessor of a personal computer, a tablet or a smartphone.
[0037] In particular, the chatbot 3 is realized by means of artificial intelligence techniques using machine learning or deep machine learning.
[0038] Even more in particular, the chatbot 3 uses Human Language Processing (Natural Language Processing, abbreviated NLP) techniques relating to the interaction between a machine and the human language, based on which the chatbot is able to understand the content of a text in natural language.
[0039] The chatbot 3 is realized with ChatGPT developed by OpenAI (https: / / chat.openai.com / ), which is a Large Language Model (LLM) able to perform a multitude of different tasks.
[0040] Alternatively, the chatbot 3 is realized with Open Assistant (https: / / open- assistant.io) or LLaMA, or even with other open source LLMs.
[0041] The sub-system 5 belongs to the human subject who owns the personal data.
[0042] The sub-system 5 is realized partly by means of a software program executed on a processing unit (for example, a microprocessor of a personal computer, a tablet or a smartphone) and partly by means of hardware.
[0043] The sub-system 5 comprises a processing unit 5-1 and a memory 5-2.
[0044] The memory 5-2 is configured to store a table comprising an association between personal data and corresponding anonymous label values, as will be explained in more detail below.
[0045] Advantageously, the memory 5-2 is of a volatile type (for example, a RAM memory), so as to only temporarily save the personal data for the time necessary to process them.
[0046] Note that the memory 5-2 may be both internal and external to the sub-system 5.
[0047] The processing unit 5-1 in turn comprises: a personal data identification unit 5-1.1 ; a personal data confirmation unit 5-1.2; a personal data expansion unit 5-1 .3; a masking processing unit 5-1.4; an anonymous text message generator 5-1 .5; a query unit 5-1 .6; a generator of a response text message 5-1 .7.
[0048] The personal data identification unit 5-1.1 is configured to receive as input a text message in natural language MSG_I, which can be generated by a human subject directly in text form or by means of a voice / text conversion of a voice message of the human subject; alternatively, the text message can be extracted from the content of a digital file (for example, an MsWord file) or from text found by means of a web search.
[0049] The personal data identification unit 5-1.1 has the function of automatically identifying the presence of personal data associated with a human subject (user) contained within the input text message MSG_I, generating as output a list of personal data S_sd.
[0050] The term "personal data" means information identifying or making identifiable, directly or indirectly, a natural person.
[0051] In particular, Ell Regulation no. 2016 / 679 (GDPR) defines the following personal data in Articles 8 and 9: data permitting the direct identification of a person, such as the personal data (for example, the name and surname of a person, the date of birth, the residence address, the e-mail address) and images; data permitting the indirect identification of a person, such as an identification number, for example, the tax code, the IP address, the vehicle registration number of the person, the credit card number of the person, the bank account number of the person, the telephone number; sensitive data, revealing the racial or ethnic origin of a person, their religious or philosophical beliefs, their political opinions, membership to parties, unions, associations or organizations of a religious, philosophical, political or trade union nature, data relating health status (physical or mental), data relating sexual life or sexual orientation, genetic data, biometric data; judicial data, or data relating criminal convictions and offences; data relating electronic communications (via the Internet or telephone) and those permitting geolocation, providing information on the places frequented and on the movements.
[0052] Note that the invention is applicable not only for masking personal data, but also for other types of data, such as for example concepts or ideas.
[0053] In particular, the personal data identification unit 5-1.1 performs said automatic identification of sensitive data by means of one or more of the following techniques: identification of strings of regular characters, known as Regular Expression techniques (abbreviated REGEX), such as for example a telephone number, an e-mail address, a date, a time instant, a tax code, a number of a credit card, a number of a bank account, a website address (URL), an IP address; identification of entity names, known as Named-entity recognition (abbreviated NER), such as for example name and surname of a person, name of a geographical location, name of an institution or organization, name of a product on the market, name of a work project; identification of a set of words belonging to a category of a plurality of categories of personal data, such as for example the following categories: payment information associated with a person, information relating to a person's state of health (physical or mental), information relating to a person's religious or philosophical beliefs, information relating to a person's sexual life or sexual orientation, information relating to a racial or ethnic origin of a person, information relating to a person's interests in politics, information relating to religious or philosophical beliefs, information relating to a person's membership to parties, unions, associations or organizations of a religious, philosophical, political or trade union nature, data relating to a person's sexual life or sexual orientation, a person's genetic data, a person's biometric data.
[0054] The personal data confirmation unit 5-1 .2 is connected in input with the personal data identification unit 5-1 -.1 and is configured to receive therefrom the list of identified portions of the personal data.
[0055] The personal data confirmation unit 5-1 .2 has the function of filtering the list of the identified portions of the personal data, confirming or deleting one or more identified personal data from the list, as a function of the value of a selection signal S_sel generated by the human user.
[0056] In other words, the human user who has pronounced a question or has provided a text to the chatbot 3 (and / or who has uploaded documents with personal data) has the possibility of deciding whether to actually block one or more of the personal data that has been automatically identified by means of the personal data identification unit 5-1.1.
[0057] The personal data confirmation unit 5-1 .2 then generates as output a reduced list S_sd_r of the identified portions of the personal data comprising at least a part of the identified personal data received as input.
[0058] The personal data expansion unit 5-1.3 is connected in input with the personal data confirmation unit 5-1 .2 and is configured to receive therefrom the reduced list of the personal data.
[0059] The personal data expansion unit 5-1.3 has the function of adding one or more personal data to the reduced list, as a function of the value of an expansion signal S_exp generated by the human user carrying at least one further personal data item.
[0060] In other words, the human user who has pronounced the question towards the chatbot 3 (and / or who has uploaded documents with personal data) also has the possibility of adding one or more personal data that have not been automatically identified by means of the personal data identification unit 5-1.1.
[0061] The personal data expansion unit 5-1 .3 then generates as output an expanded list of personal data S_sd_y comprising the personal data of the reduced list S_sd_r and also the personal data received by means of the expansion signal S_exp.
[0062] The masking processing unit 5-1 .4 is connected in input with the personal data expansion unit 5-1.3 and is configured to receive therefrom the expanded list of personal data S_sd_e.
[0063] The masking processing unit 5-1.4 has the function of substituting, in the expanded list of personal data S_sd i, the personal data (single words or a set of several contiguous words or an entire sentence or paragraph) with respective anonymous labels, generating a list S_sd_mk of one or more anonymous labels associated with the corresponding personal data.
[0064] In particular, each label comprises a name (i.e. a textual description) correlated to the content of the personal data that has been substituted.
[0065] The term “correlated" means that there is at least a semantic relationship between the personal data and the assigned name that substituted the personal data; for example, the personal data and the assigned name are semantically similar.
[0066] In one embodiment, the anonymous label name is selected from the following list: DATE: represents personal data of a date type, such as for example 1 December 2022;
[0067] TIME: represents personal data of the type instant of time, such as for example 11 :30 am;
[0068] PERSON NAME: represents personal data of the type own person name (first name and surname), such as for example Mario Rossi;
[0069] PHONE NUMBER: represents personal data of the type telephone number of a person;
[0070] DATE OF BIRTH: represents personal data of the type date of birth of a person;
[0071] ADDRESS: represents personal data of the type address of residence of a person;
[0072] TAX CODE: represents personal data of the type tax code of a person, such as for example ABCEFG73E08F305I;
[0073] CREDIT CARD NUMBER: represents personal data of the type of number of a credit card of a person;
[0074] BANK ACCOUNT NUMBER: represents personal data of the type bank account number of a person, such as for example IBAN;
[0075] URL: represents personal data of the address type of a website;
[0076] IP ADDRESS: represents personal data of the type IP (Internet Protocol) address;
[0077] LOCATION: represents personal data of type name of a geographical location;
[0078] ORGANIZATION NAME: represents personal data of the type names of institutions or organizations;
[0079] PRODUCT NAME: represents personal data of the type names of products on the market;
[0080] PROJECT NAME: represents personal data of the type names of a work project;
[0081] HEALTH DATA: represents personal data of the type health information of a person;
[0082] POLITICAL INTERESTS: represents personal data of the type political interests of a person;
[0083] RELIGIOUS INTERESTS: represents personal data of the type religious or philosophical beliefs of a person;
[0084] ETHNICITY: represents personal data of the type the racial or ethnic origin of a person; ORGANIZATIONS: represents personal data of the type membership to parties, unions, associations or organizations of a religious, philosophical, political or trade union nature;
[0085] SEXUAL ORIENTATION: represents personal data relating to sexual life or sexual orientation;
[0086] GENETICS DATA: represents personal data of the type genetic data of a person;
[0087] BIOMETRIC DATA: represents personal data of the type biometric data of a person, such as for example a voice, facial or fingerprint profile of a person;
[0088] LEGAL DATA: represents personal data relating to judicial data of a person:
[0089] GEOGRAPHIC COORDINATES: represents personal data of geographical location (geolocated) of a person.
[0090] In one embodiment, the name of the anonymous label is delimited by at least two special characters, such as for example the less-than sign (i.e. <) and the greater-than sign (i.e. >), or two less-than signs (i.e. « ) and two greater-than signs (i.e. » ) .
[0091] For example, in the event that it is identified that the personal data is the name and surname of a person named Mario Rossi, the masking processing unit 5-1.4 substitutes Mario Rossi with the following anonymous label: <PERSON NAME >.
[0092] Note that several other types of format can be used to delimit the anonymous label of the data correlated to the personal data, such as for example: open and closed parentheses of the round type, i.e. (PERSON NAME) in the considered example of the name and surname of the person; open and closed parentheses of the square type, i.e. [PERSON NAME] in the considered example of name and surname of person; open and closed parentheses of the brace type, i.e. {PERSON NAME} in the considered example of the name and surname of the person; or it is possible to use other types of special characters.
[0093] In one embodiment, each anonymous label further comprises a unique identifier uniquely associated with each name of the considered anonymous label.
[0094] In particular, the anonymous label comprises a first field containing the name having a semantic relationship with the personal data and a second field containing the unique identifier uniquely associated with the name of the first field.
[0095] The unique identifier is for example an integer number, which can be chosen randomly or in ascending or descending order or based on other criteria. The unique identifier makes it possible to distinguish, within the same assigned name of the anonymous label (i.e. of the same type of personal data), two or more different personal data within the same name of the anonymous label, i.e. by assigning different values of the unique identifier for different personal data belonging to the same name of the anonymous label (i.e. different personal data of the same type).
[0096] For example, in the event that it is identified that the personal data is the own name of two people called Mario Rossi and Andrea Bianchi, the masking processing unit 5-1 .4 assigns the integer 1 to Mario Rossi and the integer 2 to Andrea Bianchi, then it substitutes Mario Ross / with the following first anonymous label < PERSON NAME 1 > and it substitutes Andrea Bianchi with the following second anonymous label <PERSON NAME 2>: in this way the chatbot 3 will be able to understand that the first anonymous label refers to the name and surname of a person other than the one associated with the second anonymous label.
[0097] The masking processing unit 5-1.4 is also configured to store, in the volatile memory 5-2, the list S_sd_mk of the anonymous labels and the respective substituted personal data, generating a table in which each row comprises the personal data and the respective value of the anonymous label.
[0098] The anonymized text message generator 5-1.5 is connected in input with the masking processing unit 5-1.4 and is configured to receive the list of one or more anonymous labels and the input text message in natural language MSG_I and to generate from these an anonymized text message in natural language MSG_MSK, comprising the anonymous labels in place of the personal data.
[0099] For example, assume that the input text message in natural language MSG_I is as follows:
[0100] "Mario Rossi is very rich"
[0101] It is also assumed that the personal data identification unit 5-1.1 has identified that the set of words "Mario Rossi" is personal data to be protected (i.e. to be hidden from the chatbot 3) and that the masking processing unit 5-1.4 has associated the anonymous label < PERSON NAME 25> to "Mario Rossi".
[0102] In this example the anonymous text message generator 5-1.5 generates the following anonymized text message MSG_MSK: "< PERSON NAME 25> is very rich"
[0103] The query unit 5-1.6 is connected in input / output with the anonymous text message generator 5-1 .5 and in output with the response text message generator 5-1 .7. The query unit 5-1.6 has the function of forwarding to the chatbot 3 the anonymized text message MSG_MSK carrying a question in natural language comprising the anonymous labels and has the function of receiving from the chatbot 3 a further anonymized text message in natural language MSG_MSK_A carrying the response in natural language of the chatbot 3 to the received question in natural language, wherein the response in natural language contains at least a part of the anonymous labels of the table saved in the memory 5-2.
[0104] The query unit 5-1 .6 also has the function of forwarding as output the further anonymized text message in natural language MSG_MSK_A towards the response text message generator 5-1 .7.
[0105] The chatbot 3 has the function of carrying out a processing of the content of the anonymized text message MSG_MSK carrying a question in natural language, for example using Natural Language Processing (NLP) techniques and a Large Language Model (LLM), generating from this the further anonymized text message MSG_MSK_A carrying the answer in natural language.
[0106] The response text message generator 5-1.7 is connected in input with the query unit 5-1.6 and is configured to receive therefrom the further anonymized text message in natural language MSG_MSK_A.
[0107] The response text message generator 5-1 .7 is also connected to the memory 5-2 and is configured to read therefrom the table containing the association between the personal data and the corresponding values of the anonymous labels.
[0108] The response text message generator 5-1.7 has the function of reading from the memory 5-2 the table containing the association between the personal data and the corresponding values of the anonymous labels, then substituting each anonymous label with the respective associated personal data and finally generating from this as output a text message in natural language MSG_O carrying the response in plain text of the chatbot 3, in which the anonymous labels have been substituted by the corresponding values of the personal data.
[0109] The operation of the electronic system 1 will now be described, also referring to Figure 1 .
[0110] It is assumed that the electronic system 1 receives as input the following text document having the following content:
[0111] "The employee Mario Rossi, bom in Milan on 1 January 1990, has successfully completed the project PRJ_0 and will therefore receive a salary increase." Furthermore, it is assumed that the human user to pronounce the following sentence:
[0112] "Summarize Mario Rossi's progress"
[0113] It is also assumed that the personal data confirmation unit 5-1 .2 and the personal data expansion unit 5-1.3 do not make any changes to the personal data that are automatically identified.
[0114] The personal data identification unit 5-1.1 then receives the input text message MSG_I carrying the text and the sentence pronounced indicated above and it is assumed that the personal data identification unit 5-1.1 is able to identify in it the presence of the following personal data:
[0115] Mario Rossi;
[0116] Milan;
[0117] 1 January 1990
[0118] PRJ-O.
[0119] The masking processing unit 5-1 .4 substitutes the personal data indicated above with the following respective anonymous labels:
[0120] "Mario Rossi" is substituted with <NAME 45>;
[0121] "Milan" is substituted with <T0WN 37>;
[0122] "1 January 1990" is substituted with <DATE 104>;
[0123] "PRJ_0" is substituted with <PROJECT 12>.
[0124] In addition, the masking processing unit 5-1.4 stores in the memory 5-2 the following table of personal data-anonymous labels association:
[0125] As a result, the anonymous text message generator 5-1.5 generates the following anonymized text message MSG_MSK:
[0126] "The employee <NAME 45>, bom in <T0WN 37> ON <DATE 104>, has successfully completed the project <PROJECT 12> and will therefore receive a salary increase." “Summarize <NAME 45>'s progress” The chatbot 3 receives as input the anonymized text message MSG_MSK reported above and generates as output the anonymized text message in natural language MSG_MSK_A carrying the following response:
[0127] “The employee <NAME 45> has successfully concluded the project <PROJECT 12>
[0128] Subsequently, the response text message generator 5-1.7 receives as input the anonymized text message in natural language MSG_MSK_A indicated above, reads from the memory 5-2 the table comprising the association between <NAME 45> and "Mario Rossi" and the association between <PROJECT 12> and "PRJ_0", then it substitutes, in the anonymized text message in natural language MSG_MSK_A, the anonymous label <NAME 45> with "Mario Rossi" and the anonymous label <PROJECT 12> with "PRJ_0", generating as output the following output text message MSG_O:
[0129] "The employee Mario Rossi has successfully concluded the project PRJ_0"
[0130] It is also an object of the present invention a method for protecting personal data of a user for a chatbot.
[0131] The method for protecting personal data of a user comprises step a) of receiving a text message in natural language MSG_I and identifying therefrom at least one portion of text or word representative of personal data associated with the user, step b) of storing, in a volatile memory, the identified portions of the personal data, step c) of substituting, each identified portion of text or word of the personal data of the text message in natural language, with a respective anonymous label, each label comprising a name, selected from a plurality of different defined names, having a semantic relationship with the personal data of the identified portion, thus generating an anonymized text message in natural language MSG_MSK comprising at least one anonymous label, step d) of storing, in said volatile memory, an association between the at least one identified portion of the personal data and the respective value of the substituted anonymous label, step e) of storing, in said volatile memory, an association between the at least one identified portion of the personal data and the respective value of the substituted anonymous label, step e) of providing said anonymized text message in natural language MSG_MSK as input to the chatbot and receiving therefrom as output a further anonymized text message in natural language MSG_MSK_A representative of the response of the chatbot, wherein said further anonymized text message in natural language comprises at least one anonymous label, step f) of reading, from the volatile memory, the value of the portion of the personal data associated with the at least one anonymous label of the further anonymized text message in natural language, and step g) of substituting, each anonymous label of the further anonymized text message in natural language, with the respective associated value of the portion of the personal data, generating a further text message in natural language (MSG_O) comprising at least one portion of the personal data.
[0132] In one embodiment, step c) comprises further assigning a unique identifier for the corresponding name of each anonymous label.
[0133] In particular, step a) comprises identifying in the text message in natural language (MSG_I) at least two portions of text or words representative of the same type of personal data. Furthermore, step c) further comprises assigning a respective unique identifier for each of the at least two identified portions of text or words, comprises substituting, each of the at least two identified portions of text or words, with a respective anonymous label, wherein each anonymous label comprises the same name having a same semantic relationship with the same type of identified personal data and further comprises a respective assigned unique identifier, and comprises generating the anonymized text message in natural language comprising at least two anonymous labels having respective unique identifiers (i.e. different from each other).
[0134] In one embodiment, in step c) of the method for protecting personal data the name and / or the unique identifier are delimited by two special characters, such as for example the less-than sign < and the greater-than sign >, or an open parenthesis (for example round parenthesis (, square parenthesis [ or brace parenthesis { ) and a closed parenthesis (respectively round parenthesis), square parenthesis ] or brace parenthesis }).
[0135] In one embodiment, in step a) said identification comprises identifying a string of regular characters in the text message representative of personal data associated with the user, such as for example a telephone number, an e-mail address, a date, a time instant, a tax code, a number of a credit card, a number of a bank account, a website address, an IP address, wherein in step c) the name of the anonymous label has a semantic relationship with said string of regular characters, in particular a semantic relationship with the telephone number, the e-mail address, the date, the time instant, the tax code, the number of a credit card, the bank account number, the website address, the IP address.
[0136] In one embodiment, in step a) said identification comprises classifying names of entities based on a plurality of classes of personal data of names, wherein said plurality of classes comprises at least one of names and surnames of persons, name of a geographical location, name of an institution or organization, name of a product on the market, name of a work project, and wherein in step c) the name of the anonymous label has a semantic relationship with the name of the entity, for example a semantic relationship with the own name of the person, the name of the geographical location, the name of the institution or organization, the name of the product on the market, the name of the work project.
[0137] In one embodiment, in step a) said identification comprises identifying a set of words belonging to a category of a plurality of categories of personal data, wherein the plurality of categories of personal data is as follows: payment information associated with a person, information relating to a person's state of health, information relating to a person's religious or philosophical beliefs, information relating to a person's sexual life or sexual orientation, information relating to a racial or ethnic origin of a person, information relating to a person's membership to parties, unions, associations or organizations of a religious, philosophical, political or trade union nature, wherein in step c) the name of the anonymous label has a semantic relationship with the category identified among the plurality of categories of personal data.
[0138] In one embodiment, the memory is of volatile type, the method further comprising, after step g), step h) of deleting, from the volatile memory, the information of the identified portions of the personal data.
[0139] In one embodiment, the method further comprises, between step b) and step c), the steps of: generating a list of a plurality of identified portions of personal data, filtering said list by reducing the number of identified portions of personal data, generating a reduced list of the plurality of portions of personal data, wherein step c) comprises substituting the identified portions of personal data of the reduced list.
[0140] In one embodiment, the method further comprises adding, in the reduced list of the identified portions of personal data, at least one further portion of text or at least one word representative of personal data, thereby generating an expanded list of a further plurality of portions of personal data, wherein step c) comprises substituting the identified portions of personal data of the expanded list.
[0141] In one embodiment, the method further comprises, prior to step e), the step of providing, as input to the chatbot or Large Language Model, a training text message in natural language carrying instructions indicative of the meaning of the anonymous labels and of the plurality of defined names. In this way it is possible to train the chatbot or the Large Language Model so that it is able to better understand the text in natural language containing the anonymous labels defined according to the present invention, thereby generating a more accurate response.
[0142] Considering again the example of anonymous labels of the type PERSON NAME in substitution of the name and surname of a person, it is possible to provide as input to the chatbot or Large Language Model the following training text message:
[0143] "If in the following text you find the notation [PERSON NAME] , it means that a part of the text containing personal data relating to the name and surname of a person has been masked. If in the response you have to refer to the same masked personal data, use the same notation."
[0144] Another example in which the unique identifier of anonymous label names is used is as follows:
[0145] "If in the following text you find the notation [PERSON NAME n] or [PERSON name_n], it means that a part of the text containing personal data relating to the name and surname of a person has been masked, wherein the index n is a number used to distinguish the name and surname of different people. If in the response you have to refer to the same masked personal data, use the same notation."
[0146] It is also an object of the present invention a computer program comprising portions of software code executed on a processing unit, such as for example a microprocessor of a personal computer or a smartphone.
[0147] The software program performs step a) of receiving a text message in natural language and identifying therefrom at least one portion of text or word representative of personal data associated with the user, step b) of storing, in a memory, the identified portions of the personal data, step c) of substituting, each identified portion of text or word of the personal data of the text message in natural language, with a respective anonymous label, each label comprising a name, selected from a plurality of different defined names, having a semantic relationship with the personal data of the identified portion, thus generating an anonymized text message in natural language comprising at least one anonymous label, step d) of storing, in said memory, an association between the at least one identified portion of the personal data and the respective value of the substituted anonymous label, step e) of providing said anonymized text message in natural language as input to the chatbot or Large Language Model and receiving therefrom as output a further anonymized text message in natural language representative of the response of the chatbot or Large Language Model, wherein said further anonymized text message in natural language comprises at least one anonymous label, step f) of reading, from the volatile memory, the value of the portion of the personal data associated with the at least one anonymous label of the further anonymized text message in natural language, and step g) of substituting, each anonymous label of the further anonymized text message in natural language, with the respective associated value of the portion of personal data, generating a further text message in natural language comprising at least one portion of personal data.
Claims
CLAIMS1. Computer-implemented method for protecting personal data of a user for a chatbot (3) or for a Large Language Model, the method comprising the steps of: a) receiving a text message in natural language (MSG_I) and identifying therefrom at least one portion of text or word representative of personal data associated with the user; b) storing, in a memory (5-2), the identified portions of the personal data; c) substituting, each identified portion of text or word of the personal data of the text message in natural language, with a respective anonymous label, each label comprising a name, selected from a plurality of different defined names, having a semantic relationship with the personal data of the identified portion, thus generating an anonymized text message in natural language (MSG_MSK) comprising at least one anonymous label; d) storing, in said memory, an association between the at least one identified portion of the personal data and the respective value of the substituted anonymous label; e) providing said anonymized text message in natural language (MSG_MSK) as input to the chatbot or Large Language Model and receiving therefrom as output a further anonymized text message in natural language (MSG_MSK_A) representative of the response of the chatbot or of the Large Language Model, wherein said further anonymized text message in natural language comprises at least one anonymous label selected from the at least one anonymous label included in said anonymized text message in natural language; f) reading, from the memory, the value of the portion of the personal data associated with the at least one anonymous label of the further anonymized text message in natural language; g) substituting, each anonymous label of the further anonymized text message in natural language, with the respective associated value of the portion of the personal data, generating a further text message in natural language (MSG_O) comprising at least one portion of personal data.
2. Method according to claim 1 , wherein step a) comprises identifying in the text message in natural language (MSG_I) at least two portions of text or words representative of a same type of personal data,wherein step c) further comprises: assigning a respective unique identifier for each of the at least two identified portions of text or words; substituting, each of the at least two identified portions of text or words, with a respective anonymous label, wherein each anonymous label comprises a same name having a same semantic relationship with the same type of identified personal data and further comprises a respective assigned unique identifier; generating the anonymized text message in natural language comprising at least two anonymous labels having respective unique identifiers.
3. Method according to claim 1 or 2, wherein the unique identifier is an integer number that is assigned pseudo-random ly or in ascending or descending order.
4. Method according to any one of the preceding claims, wherein in step c) the name and / or the unique identifier are delimited by at least two special characters, in particular selected from: one less-than sign and one greater-than sign, that is < >; two less-than signs and two greater-than signs, that is « »; an open square parenthesis and a closed parenthesis, that is [ ]; an open round parenthesis and a closed round parenthesis, that is ( ); an open brace parenthesis and a closed brace parenthesis, that is { }.
5. Method according to any one of the preceding claims, wherein in step a) said identification comprises identifying a string of regular characters in the text message representative of personal data associated with the user, in particular at least one of a telephone number, an e-mail address, a date, a time instant, a tax code, a number of a credit card, a number of a bank account, a website address, an IP address, and wherein in step c) the name of the anonymous label has a semantic relationship with said string of regular characters, in particular a semantic relationship with the telephone number, the e-mail address, the date, the time instant, the tax code, the number of a credit card, the bank account number, the website address, the IP address.
6. Method according to any one of the preceding claims, wherein in step a) said identification comprises classifying entity names based on a plurality of classes of personal data of names, wherein said plurality of classes comprises at least one of name and surname of persons, name of a geographical location, name of an institution or organization, name of a product on the market, name of a work project, and where in step c) the name of the anonymous label has a semantic relationship withthe name of the entity, in particular a semantic relationship with the name and surname of the person, the name of the geographical location, the name of the institution or organization, the name of the product on the market, the name of the work project.
7. Method according to any one of the preceding claims, wherein in step a) said identification comprises identifying a set of words belonging to a category of a plurality of categories of personal data, wherein the plurality of categories of personal data is as follows: payment information associated with a person; information relating to a person's state of health; information relating to a person's religious or philosophical beliefs; information relating to a person's sexual life or sexual orientation; information relating to the racial or ethnic origin of a person; information relating to a person's membership of parties, unions, associations or organizations of a religious, philosophical, political or trade union nature; and wherein in step c) the name of the anonymous label has a semantic relationship with the category identified among the plurality of categories of personal data.
8. Method according to any one of the preceding claims, wherein the memory is of volatile type, the method further comprising, after step g), step h) of deleting, from the volatile memory, the information of the identified portions of the personal data.
9. Method according to any one of the preceding claims, further comprising, between step b) and step c), the steps of: generating a list of a plurality of identified portions of personal data; filtering said list by reducing the number of identified portions of personal data, generating a reduced list of the plurality of portions of personal data; and wherein step c) comprises replacing the identified portions of personal data from the reduced list, the method further comprising adding, in the reduced list of identified portions of personal data, at least one further portion of text or at least one word representative of personal data, thereby generating an expanded list of a further plurality of portions of personal data, wherein step c) comprises substituting the identified portions of personal data from the expanded list.
10. Method according to any one of the preceding claims, further comprising, prior to step e), the step of providing, as input to the chatbot or to the Large Language Model, atraining text message in natural language carrying instructions indicative of the meaning of the anonymous labels and of the plurality of defined names.
11. Non-transitory computer-readable storage medium having a program comprising portions of software code adapted to perform the steps of the method according to claims 1-10, when said program is run on at least one computer.
12. Electronic system to protect personal data of a user, the system comprising a processing unit and a memory configured to store portions of the user's personal data, wherein the processing unit is configured to: receive a text message in natural language and identify therefrom at least one portion of text or word representative of personal data associated with the user; store, in the memory, the identified portions of the personal data; substitute, each identified portion of the personal data, with a respective anonymous label comprising a name, selected from a plurality of different defined names, having a semantic relationship with the personal data of the identified portion, thus generating an anonymized text message in natural language comprising at least one anonymous label; store, in said memory, an association between the at least an identified portion of the personal data and the respective value of the anonymous label; provide, as input to a chatbot or Large Language Model, the anonymized text message in natural language and receive, from the chatbot or from the Large Language Model, a further anonymized text message in natural language representative of the response of the chatbot, wherein said further anonymized text message in natural language comprises at least one anonymous label selected from the at least one anonymous label included in said anonymized text message in natural language; read, from the memory, the value of the portion of the personal data associated with the at least one anonymous label of the further anonymized text message in natural language; substitute, each anonymous label of the further anonymized text message in natural language, with the respective associated value of the portion of the personal data, generating a further text message in natural language comprising at least one portion of personal data.
13. Electronic system according to claim 12, further comprising a chatbot or a Large Language Model configured to: receive as input said anonymized text message in natural language;process the input anonymized text message and generate, as a function of said processing, the further anonymized text message; generate as output the further anonymized text message.
14. Chatbot configured to: - receive as input an anonymized text message in natural language generated by means of steps a), b), c), d) of the method according to claims 1-10; generate as output a further anonymized text message in natural language (MSG_MSK_A) representative of a response generated as a function of the input anonymized text message.
15. Large Language Model configured to: receive as input an anonymized text message in natural language generated by means of steps a), b), c), d) of the method according to claims 1-10; generate as output a further anonymized text message in natural language (MSG_MSK_A) representative of a response generated as a function of the input anonymized text message.
Citation Information
Patent Citations
System and methods for natural pseudonymization of text
EP3726414A1
Utility-preserving text de-identification with privacy guarantees
US20210334455A1
