Method for obtaining communication record based on image recognition and related device
Patent Information
- Application Number
- CN202310166918.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-17
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2043-02-17
AI Technical Summary
[0003]有鉴于此,本发明提供了基于图像识别获取沟通记录的方法及相关装置,以解决无法快速和准确的获得客户跟进记录
[0015] This method acquires screenshots of instant messaging conversations, uses an OCR framework to perform content recognition on the screenshots to obtain message bubble positions and text paragraphs, and then filters the text paragraphs based on the message bubble positions to obtain the communication records. By utilizing the OCR framework to recognize text, obtain message bubble positions and text paragraphs, and then filtering the text paragraphs based on the message bubble positions to obtain the communication records, the communication records are clearly segmented and the relationships between the parties are explicit. This allows for the quick and accurate acquisition of communication records when following up with customers, and managers can directly obtain valuable information by reviewing the communication records.
Smart Images

Figure CN116206299B_ABST
Abstract
Description
[Technical Field]
[0001] This invention relates to the field of text recognition technology, and in particular to a method and related apparatus for obtaining communication records based on image recognition. [Background Technology]
[0002] The current customer follow-up method involves manually entering relevant content into text format and uploading screenshots of the instant messaging conversation as images or attachments for archiving. Uploading customer follow-up content as images or attachments requires analysis of the conversation, making it difficult to quickly and accurately obtain customer follow-up records. Managers also find it difficult to extract valuable information from fragmented images or attachments. [Summary of the Invention]
[0003] In view of this, the present invention provides a method and related apparatus for obtaining communication records based on image recognition, in order to solve the problem of being unable to quickly and accurately obtain customer follow-up records.
[0004] The specific technical solution of the first embodiment of the present invention is as follows: a method for obtaining communication records based on image recognition, the method comprising: obtaining a screenshot of an instant messaging conversation; calling an OCR framework to perform content recognition on the screenshot of the instant messaging conversation to obtain the message bubble position and text paragraph in the screenshot of the instant messaging conversation; filtering the text paragraph according to the message bubble position to obtain the communication record.
[0005] Preferably, the step of calling the OCR framework to perform content recognition on the instant messaging conversation screenshot to obtain the message bubble position and text paragraph in the instant messaging conversation screenshot includes: calling the OCR framework to recognize the content of the instant messaging conversation screenshot to obtain a first rectangular area and text paragraph in the screenshot; optimizing the first rectangular area to obtain the message bubble position.
[0006] Preferably, optimizing the first rectangular region to obtain the message bubble position includes: filtering the first rectangular region according to preset rules to obtain a second rectangular region; sorting the second rectangular region and classifying the dialog rectangle relationships to obtain the message bubble position; the preset rules include: filtering out rectangles within the first rectangular region whose image width ratio is within a first preset range; filtering out rectangles within the first rectangular region whose areas intersect; filtering out rectangles within the first rectangular region whose image positions are centered, wherein the image position is centered when the difference between the first filter value and the second filter value is less than a first preset threshold; the first filter value is the left margin of the first coordinate distance of the rectangle within the first rectangular region from the instant messaging dialog screenshot image; the second filter value is the right margin of the second coordinate distance of the rectangle within the first rectangular region from the instant messaging dialog screenshot image.
[0007] Preferably, the step of sorting the second rectangular region and classifying the dialogue rectangle relationships to obtain the message bubble position includes: sorting the second rectangular region according to the rectangle's vertical coordinate to obtain a rectangular region sorting sequence; classifying the rectangular region sorting sequence according to the dialogue rectangle relationships to obtain our dialogue rectangle and the other party's dialogue rectangle, wherein the our dialogue rectangle and the other party's dialogue rectangle constitute the message bubble position; wherein, the dialogue rectangle relationship is defined as follows: when the ratio of the fourth filter value to the third filter value of the rectangle within the second rectangular region is less than a second preset threshold, the rectangle within the second rectangular region is our dialogue rectangle; otherwise, it is the other party's dialogue rectangle; wherein, the third filter value is the left margin of the third coordinate of the rectangle within the second rectangular region from the instant messaging dialogue screenshot image; the fourth filter value is the right margin of the fourth coordinate of the rectangle within the second rectangular region from the instant messaging dialogue screenshot image.
[0008] Preferably, the step of filtering the text paragraph based on the message bubble position to obtain the communication record includes: intersecting the first region formed by the message bubble position with the second region formed by the text paragraph to obtain an intersecting region; filtering the text paragraph based on the intersecting region to obtain a communication text paragraph, wherein the text within the communication text paragraph is the communication record.
[0009] Preferably, the step of filtering the text paragraphs based on the intersecting region to obtain communication text paragraphs, wherein the text within the communication text paragraphs is a communication record, includes: filtering out all text paragraphs whose ratio of a fifth filter value to the width of the intersecting region is within a second preset range; the fifth filter value is the difference between the left coordinate of the text paragraph and the left coordinate of the corresponding intersecting region; the filtered text paragraphs are communication text paragraphs, and the text within the communication text paragraphs is a communication record.
[0010] Preferably, after filtering out text paragraphs whose ratio of the fifth filter value to the width of the intersecting rectangle is within the second preset threshold range, the method further includes: filtering out text paragraphs whose ratio of the text paragraph area to the area of the intersecting rectangle is within the third preset range and whose ratio of the text paragraph area to the area of the instant messaging screenshot is within the fourth preset range; the filtered text paragraphs are communication text paragraphs, and the text within the communication text paragraphs is a communication record.
[0011] The specific technical solution of the second embodiment of the present invention is as follows: a virtual device for obtaining communication records based on image recognition, the device comprising: an acquisition unit, an identification unit, and a filtering unit; the acquisition unit is used to acquire screenshots of instant messaging conversations; the identification unit is used to identify the message bubble positions and text paragraphs based on the screenshots of instant messaging conversations; the filtering unit is used to filter the text paragraphs based on the message bubble positions to obtain communication records.
[0012] The specific technical solution of the third embodiment of the present invention is as follows: a device for acquiring communication records based on image recognition, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the method as described in any one of the first embodiments of the present invention.
[0013] The specific technical solution of the fourth embodiment of the present invention is as follows: a computer-readable storage medium storing a computer program, characterized in that, when the computer program is executed by a processor, the processor performs the steps of the method as described in any one of the first embodiments of the present invention.
[0014] Implementing the embodiments of the present invention will have the following beneficial effects:
[0015] This method acquires screenshots of instant messaging conversations, uses an OCR framework to perform content recognition on the screenshots to obtain message bubble positions and text paragraphs, and then filters the text paragraphs based on the message bubble positions to obtain the communication records. By utilizing the OCR framework to recognize text, obtain message bubble positions and text paragraphs, and then filtering the text paragraphs based on the message bubble positions to obtain the communication records, the communication records are clearly segmented and the relationships between the parties are explicit. This allows for the quick and accurate acquisition of communication records when following up with customers, and managers can directly obtain valuable information by reviewing the communication records. [Attached Image Description]
[0016] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 A flowchart for obtaining communication records based on image recognition;
[0018] Figure 2 This is a screenshot of an instant messaging conversation.
[0019] Figure 3 Flowchart for obtaining message bubble positions and text paragraphs;
[0020] Figure 4 To optimize the flowchart for the first rectangular region;
[0021] Figure 5 This is a schematic diagram of the first and second filter values;
[0022] Figure 6 This is a diagram illustrating our dialogue rectangle and the other party's dialogue rectangle.
[0023] Figure 7 Flowchart for filtering text paragraphs based on message bubble position;
[0024] Figure 8 A structural diagram of a communication record acquisition system based on image recognition;
[0025] Figure 9 To obtain a structural diagram of a communication recording device based on image recognition;
[0026] Figure 10 To obtain a mockup of the communication record;
[0027] Among them, 501 is the acquisition unit; 502 is the identification unit; and 503 is the filtering unit.
Detailed Implementation Methods
[0028] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0029] The terms "first," "second," etc., used in the specification, claims, and drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.
[0030] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0031] The recognition of various images, such as OCR (Optical Character Recognition), is mainly divided into three steps: text detection, text recognition, and recognition result parsing.
[0032] In specific embodiments, this application provides a method and related apparatus for obtaining communication records based on image recognition. The related apparatus includes a virtual device for obtaining communication records based on image recognition, a device for obtaining communication records based on image recognition, and a computer-readable storage medium. It can quickly and accurately obtain communication records when following up with customers, and managers can directly obtain valuable information by viewing the communication records.
[0033] In a specific embodiment, please refer to Figure 1 The flowchart illustrates a method for obtaining communication records based on image recognition, as provided in the first aspect of this application. This method ensures that the communication records are clearly segmented and the relationships between parties are explicit, enabling rapid and accurate acquisition of communication records during customer follow-ups. The method includes:
[0034] Step 101: Obtain screenshots of instant messaging conversations;
[0035] Step 102: Call the OCR framework to perform content recognition on the instant messaging chat screenshot to obtain the message bubble positions and text paragraphs in the instant messaging chat screenshot.
[0036] Step 103: Filter the text paragraphs according to the position of the message bubble to obtain the communication record.
[0037] Specifically, when salespeople need to communicate via text, such as obtaining customer contact information or increasing sales opportunities, they typically use customer follow-up systems or customer service systems to conduct text communication, forming instant messaging conversations. For screenshots of instant messaging conversations between salespeople and customers, please refer to [link / reference needed]. Figure 2 The screenshot can be local or stored in the cloud. OCR recognition can be performed locally on the device, protecting privacy and security. The device can be a mobile phone, computer, or other smart device. The OCR framework is used to perform content recognition on the screenshot of the instant messaging conversation, obtaining the message bubble positions and text paragraphs. The message bubble positions can locate the conversation in the screenshot, and the text paragraphs contain conversation information or other non-conversational content, such as rectangular buttons. The text paragraphs are filtered based on the message bubble positions to remove invalid text paragraphs and obtain the communication record. The communication record is used to display the salesperson's and customer's communication when following up with customers, forming a conversation relationship between the salesperson and the customer. Emojis, rectangular buttons, and other non-text bubbles are filtered out to make the conversation relationship clearer.
[0038] By using an OCR framework to recognize text, the location of message bubbles and text paragraphs are obtained. The text paragraphs are then filtered based on the location of the message bubbles to obtain communication records. This makes the communication records distinct and the relationships between them clear. It enables quick and accurate acquisition of communication records when following up with customers, and managers can directly obtain valuable information by reviewing the communication records.
[0039] In a specific embodiment, before calling the OCR framework to recognize the content of an instant messaging chat screenshot, the screenshot can be processed by image blur enhancement and tilt correction. After image blur enhancement and tilt correction, the image and text in the screenshot are clearer, improving the accuracy of identifying message bubble positions and text paragraphs when using the OCR framework.
[0040] In a specific embodiment, please refer to Figure 3 In step 103, the OCR framework is called to perform content recognition on the instant messaging chat screenshot, obtaining the message bubble positions and text paragraphs in the instant messaging chat screenshot, including:
[0041] Step 201: Call the OCR framework to recognize the content of the instant messaging conversation screenshot and obtain the first rectangular area and text paragraph in the screenshot;
[0042] Step 202: Optimize the first rectangular area to obtain the message bubble position.
[0043] In a specific embodiment, please refer to Figure 4 In step 202, the first rectangular area is optimized to obtain the message bubble positions, including:
[0044] Step 301: Filter the first rectangular region according to preset rules to obtain the second rectangular region;
[0045] The preset rules include: 1. Filtering out rectangles within the first rectangular area whose image width percentage falls within a preset range. For example, filtering out rectangles within the first rectangular area whose image width percentage is <2% or >90%. Considering that these rectangles are often the framework content of the instant messaging interface, which does not conform to the style of the chat bubble, even message bubbles with a lot of content will not occupy the entire width of the chat interface, thus effectively filtering out framework content; 2. Using a conventional rectangle intersection algorithm to filter out rectangles with intersecting areas within the first rectangular area. The smaller volume between intersecting rectangles will be filtered out. These rectangles are usually multiple rectangle parts recognized by the OCR framework within a rectangular area. In message bubbles, they may be some emoticons, buttons, or decorations, thus effectively filtering out non-text content in message bubbles; 3. Filtering out rectangles whose image position is centered within the first rectangular area. The image position is centered when the difference between the first filter value and the second filter value is less than a first preset threshold, which can be 10%. Please refer to [reference needed]. Figure 5 The first filter value is the distance L1 from the left side of the instant messaging screenshot image to the first coordinate (left coordinate) of the rectangle within the first rectangular area; the second filter value is the distance L2 from the right side of the instant messaging screenshot image to the second coordinate (right coordinate) of the rectangle within the first rectangular area. Considering that the rectangles filtered out in this part are usually the titles or prompts in the chat interface, and the message bubble will not be displayed in the center of the interface, the titles or prompts in the chat interface can be effectively filtered out.
[0046] Step 302: Sort the second rectangular area and classify the dialog rectangle relationships to obtain the message bubble positions.
[0047] In a specific embodiment, sorting the second rectangular area and classifying the dialog rectangle relationships to obtain the message bubble positions includes: sorting the second rectangular area according to its vertical coordinate to obtain a sorting sequence of the rectangular areas. Specifically, the vertical coordinates of the second rectangular area are sorted from smallest to largest, and this sorting is based on the chronological order of the instant messaging dialogues, with earlier dialogues on top and later dialogues on the bottom.
[0048] In a specific embodiment, the rectangular region sorting sequence is classified according to the dialogue rectangle relationship to obtain our dialogue rectangle and the other party's dialogue rectangle. Our dialogue rectangle and the other party's dialogue rectangle constitute the message bubble position. Specifically, the dialogue rectangle relationship is defined as follows: if the ratio of the fourth filter value to the third filter value of a rectangle within the second rectangular region is less than a second preset threshold, the rectangle within that second rectangular region is our dialogue rectangle; otherwise, it is the other party's dialogue rectangle. The second preset threshold can be 0.5. The third filter value is the distance from the left edge of the third coordinate (left coordinate) of the rectangle within the second rectangular region to the left edge of the instant messaging dialogue screenshot image; the fourth filter value is the distance from the right edge of the fourth coordinate (right coordinate) of the rectangle within the second rectangular region to the right edge of the instant messaging dialogue screenshot image. The text within our dialogue rectangle is the message text sent by our personnel, and the text within the other party's dialogue rectangle is the message text sent by the customer. Please refer to the diagram of our dialogue rectangle and the other party's dialogue rectangle. Figure 6 By distinguishing between our own dialogue rectangle and the other party's dialogue rectangle, we can identify the specific source of the dialogue information.
[0049] In a specific embodiment, please refer to Figure 7 In step 103, the text paragraphs are filtered according to the message bubble position to obtain the communication record, including:
[0050] Step 401: Intersect the first region formed by the message bubble positions with the second region formed by the text paragraphs to obtain the intersecting region;
[0051] Step 402: Filter the text paragraphs according to the intersecting regions to obtain communication text paragraphs, and the text in the communication text paragraphs is the communication record.
[0052] In a specific embodiment, step 402 filters the text paragraphs according to the intersecting region to obtain communication text paragraphs, and the text within the communication text paragraphs is a communication record. This includes: filtering out all text paragraphs whose ratio of the fifth filter value to the width of the intersecting region is within a second preset range; the fifth filter value is the difference between the left coordinate of the text paragraph and the left coordinate of the intersecting region corresponding to the text paragraph; the filtered text paragraphs are communication text paragraphs, and the text within the communication text paragraphs is a communication record.
[0053] Specifically, all text paragraphs whose ratio of the fifth filter value to the width of the intersection area falls within a second preset range are filtered out. This second preset range can be less than 35% and greater than 0%. Text paragraphs are typically displayed in a left-aligned layout within message bubbles; those that do not conform to this rule are usually rectangular buttons with text or other non-dialogue content areas. The fifth filter value is the difference between the left coordinate of the text paragraph and the left coordinate of the corresponding intersection area. The filtered text paragraphs are considered communication text paragraphs, and the text within these communication text paragraphs is considered communication records.
[0054] In a specific embodiment, after filtering out text paragraphs whose ratio of the fifth filter value to the width of the intersecting rectangle is within a second preset threshold range, the process further includes: filtering out text paragraphs whose ratio of the text paragraph area to the area of the intersecting rectangle is within a third preset range, and whose ratio of the text paragraph area to the area of the instant messaging chat screenshot is within a fourth preset range. The third preset range can be greater than 35%, and the fourth preset range can be greater than 3%. Common text paragraphs occupy a major portion of the message bubble, and these text paragraphs are not particularly small. Instances that do not conform to this rule are often rectangular buttons with text or other non-dialogue content areas. The filtered text paragraphs are communication text paragraphs, and the text within these communication text paragraphs is the communication record.
[0055] In a specific embodiment, please refer to Figure 8 The second embodiment of the present invention also provides a virtual device for obtaining communication records based on image recognition. The device includes: an acquisition unit 501, an identification unit 502, and a filtering unit 503; the acquisition unit 501 is used to acquire screenshots of instant messaging conversations; the identification unit 502 is used to identify the message bubble positions and text paragraphs based on the screenshots of instant messaging conversations; the filtering unit 503 is used to filter the text paragraphs based on the message bubble positions to obtain communication records.
[0056] Specifically, the recognition unit 502 calls the OCR framework to recognize the content of the instant messaging chat screenshot, obtaining a first rectangular area and text paragraphs in the screenshot; the first rectangular area is then optimized to obtain the message bubble position. Optimizing the first rectangular area to obtain the message bubble position includes: filtering the first rectangular area according to preset rules to obtain a second rectangular area; sorting the second rectangular area and classifying the dialog rectangle relationships to obtain the message bubble position; the preset rules include: filtering out rectangles within the first rectangular area whose image width ratio falls within a first preset range; filtering out rectangles within the first rectangular area whose areas intersect; filtering out rectangles within the first rectangular area whose image position is centered, where the difference between the first and second filter values is less than a first preset threshold; the first filter value is the left margin of the first coordinate of the rectangle within the first rectangular area from the instant messaging chat screenshot image; the second filter value is the right margin of the second coordinate of the rectangle within the first rectangular area from the instant messaging chat screenshot image. The process of sorting and classifying the dialogue rectangle relationships within the second rectangular region to obtain message bubble positions includes: sorting the second rectangular region according to its vertical coordinate to obtain a sorted sequence of rectangular regions; classifying the sorted sequence of rectangular regions according to the dialogue rectangle relationships to obtain our dialogue rectangles and the other party's dialogue rectangles, which together constitute the message bubble positions; wherein, a dialogue rectangle relationship is defined as follows: if the ratio of the fourth filter value to the third filter value of a rectangle within the second rectangular region is less than a second preset threshold, the rectangle within the second rectangular region is our dialogue rectangle; otherwise, it is the other party's dialogue rectangle; wherein, the third filter value is the left margin of the third coordinate of the rectangle within the second rectangular region from the instant messaging dialogue screenshot image; and the fourth filter value is the right margin of the fourth coordinate of the rectangle within the second rectangular region from the instant messaging dialogue screenshot image.
[0057] This virtual device uses an OCR framework to recognize text, obtain message bubble positions and text paragraphs, and filters the text paragraphs based on the message bubble positions to obtain communication records. This makes the communication records distinct and the relationships between them clear, enabling quick and accurate access to communication records when following up with customers. Furthermore, managers can directly obtain valuable information by viewing the communication records.
[0058] In a specific embodiment, please refer to Figure 9The third embodiment of the present invention also provides a device for obtaining communication records based on image recognition, including a memory and a processor. The memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of any of the methods in the first embodiment of the present invention. This device uses an OCR framework to recognize text to obtain message bubble positions and text paragraphs, and filters the text paragraphs according to the message bubble positions to obtain communication records. This makes the communication records clearly segmented and the relationships between contacts explicit, enabling quick and accurate acquisition of communication records during customer follow-ups. Furthermore, managers can directly obtain valuable information by viewing the communication records.
[0059] Specifically, this device uses an OCR framework to perform content recognition on screenshots of instant messaging conversations, obtaining the message bubble positions and text paragraphs within the conversation. Specifically: the OCR framework is invoked to recognize the content of the instant messaging conversation screenshot, obtaining the first rectangular area and text paragraphs in the screenshot; the first rectangular area is filtered according to preset rules to obtain the second rectangular area; the second rectangular area is sorted according to its vertical coordinate to obtain a sorted sequence of rectangular areas; the sorted sequence of rectangular areas is categorized according to the relationship between the dialogue rectangles to obtain the user's dialogue rectangle and the other party's dialogue rectangle. The user's dialogue rectangle and the other party's dialogue rectangle constitute the message bubble positions.
[0060] The process of filtering text paragraphs based on message bubble positions to obtain communication records includes: intersecting a first region formed by the message bubble positions with a second region formed by the text paragraphs to obtain an intersection area; filtering text paragraphs based on the intersection area to obtain communication text paragraphs, where the text within the communication text paragraphs is the communication record. Specifically, filtering text paragraphs based on the intersection area to obtain communication text paragraphs, where the text within the communication text paragraphs is the communication record, includes: filtering out all text paragraphs whose ratio of a fifth filter value to the width of the intersection area falls within a second preset range; the fifth filter value is the difference between the left coordinate of the text paragraph and the left coordinate of the corresponding intersection area; the filtered text paragraphs are the communication text paragraphs, where the text within the communication text paragraphs is the communication record.
[0061] In a specific embodiment, the fourth embodiment of the present invention also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it causes the processor to perform the steps of any of the methods in the first embodiment of the present invention. The readable storage medium described in this application embodiment uses an OCR framework to recognize text to obtain message bubble positions and text paragraphs, and filters the text paragraphs according to the message bubble positions to obtain communication records. This makes the communication records clearly segmented and the relationships between exchanges explicit, enabling quick and accurate acquisition of communication records when following up with customers. Furthermore, managers can directly obtain valuable information by viewing the communication records.
[0062] Specifically, the computer-readable storage medium described in this application embodiment uses an OCR framework to perform content recognition on screenshots of instant messaging conversations, obtaining the message bubble positions and text paragraphs in the instant messaging conversation screenshots. Specifically, the OCR framework is called to recognize the content of the instant messaging conversation screenshots, obtaining a first rectangular area and text paragraphs in the screenshots; the first rectangular area is filtered according to preset rules to obtain a second rectangular area; the second rectangular areas are sorted according to their vertical coordinates to obtain a rectangular area sorting sequence; the rectangular area sorting sequence is classified according to the relationship between the dialogue rectangles to obtain the user's dialogue rectangle and the other party's dialogue rectangle, and the user's dialogue rectangle and the other party's dialogue rectangle constitute the message bubble positions.
[0063] The process of filtering text paragraphs based on message bubble positions to obtain communication records includes: intersecting a first region formed by the message bubble positions with a second region formed by the text paragraphs to obtain an intersection area; filtering text paragraphs based on the intersection area to obtain communication text paragraphs, where the text within the communication text paragraphs is the communication record. Specifically, filtering text paragraphs based on the intersection area to obtain communication text paragraphs, where the text within the communication text paragraphs is the communication record, includes: filtering out all text paragraphs whose ratio of a fifth filter value to the width of the intersection area falls within a second preset range; the fifth filter value is the difference between the left coordinate of the text paragraph and the left coordinate of the corresponding intersection area; the filtered text paragraphs are the communication text paragraphs, where the text within the communication text paragraphs is the communication record.
[0064] In a specific embodiment, the communication record is obtained by using the image recognition-based method, apparatus, device, and storage medium described in this application to obtain communication records after recognizing the original instant messaging screenshot. The format of the communication record is shown in [reference needed]. Figure 10 By using OCR technology to extract real-time communication dialogues from sales staff during customer follow-up, communication records based on conversation relationships are created. While ensuring the accuracy of the original dialogue content, the content of our dialogue and the other party's dialogue are clearly defined, improving the efficiency of archiving customer follow-up content and reducing the management difficulty for managers.
[0065] In the several embodiments provided in this application, it should be understood that the disclosed system can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and there may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.
[0066] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0067] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0068] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0069] The above embodiments merely illustrate several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A method for acquiring communication records based on image recognition, characterized in that, The method includes: Get screenshots of instant messaging conversations; The OCR framework is used to recognize the content of an instant messaging conversation screenshot, obtaining the first rectangular area and text paragraph in the screenshot; The first rectangular region is filtered according to preset rules to obtain the second rectangular region; The second rectangular area is categorized according to the dialogue rectangle relationship to obtain our dialogue rectangle and the other party's dialogue rectangle. The our dialogue rectangle and the other party's dialogue rectangle constitute the message bubble position. The dialogue rectangle relationship is defined as follows: if the ratio of the fourth filter value to the third filter value of the rectangle within the second rectangular area is less than a second preset threshold, the rectangle within the second rectangular area is our dialogue rectangle; otherwise, it is the other party's dialogue rectangle. The third filter value is the left distance of the left coordinate of the rectangle within the second rectangular area from the left margin of the instant messaging dialogue screenshot image; the fourth filter value is the right distance of the right coordinate of the rectangle within the second rectangular area from the right margin of the instant messaging dialogue screenshot image. The first region formed by the location of the message bubble and the second region formed by the text paragraph intersect to obtain the intersecting region; All text segments whose ratio of the fifth filter value to the width of the intersection area is within a second preset range are filtered out. The fifth filter value is the difference between the left coordinate of the text segment and the left coordinate of the intersection area corresponding to the text segment. The filtered text paragraphs are communication text paragraphs, and the text within the communication text paragraphs is the communication record.
2. The method for obtaining communication records based on image recognition as described in claim 1, characterized in that, The preset rules include: Filter out rectangles within the first rectangular region whose image width proportions fall within a first preset range; Filter out rectangles whose areas intersect within the first rectangular region; Filter out rectangles whose image positions are centered within the first rectangular area, where the image position is centered when the difference between the first filter value and the second filter value is less than a first preset threshold; The first filter value is the distance from the first coordinate of the rectangle within the first rectangular area to the left margin of the instant messaging chat screenshot image. The second filter value is the distance from the second coordinate of the rectangle within the first rectangular area to the right margin of the instant messaging screenshot image.
3. The method for obtaining communication records based on image recognition as described in claim 1, characterized in that, The step of classifying the second rectangular region according to the dialogue rectangle relationship to obtain our dialogue rectangle and the other party's dialogue rectangle includes: Sort the second rectangular region according to its vertical coordinate to obtain the sorted sequence of the rectangular region; The rectangular regions are sorted according to the relationship between the dialogue rectangles to obtain our dialogue rectangles and the other party's dialogue rectangles.
4. The method for obtaining communication records based on image recognition as described in claim 1, characterized in that, After filtering out text paragraphs whose ratio of the fifth filter value to the width of the intersecting rectangle is within the second preset threshold range, the method further includes: Filter out text paragraphs whose ratio of text paragraph area to intersecting rectangle area is within the third preset range, and whose ratio of text paragraph area to instant messaging screenshot area is within the fourth preset range. The filtered text paragraphs are communication text paragraphs, and the text within the communication text paragraphs is the communication record.
5. A virtual device for acquiring communication records based on image recognition, characterized in that, The device includes: an acquisition unit, an identification unit, and a filtering unit; The acquisition unit is used to acquire screenshots of instant messaging conversations; The recognition unit is used to call the OCR framework to recognize the content of the instant messaging chat screenshot, obtaining a first rectangular area and text paragraphs in the screenshot; filtering the first rectangular area according to preset rules to obtain a second rectangular area; classifying the second rectangular area according to the relationship between the two chat rectangles to obtain the user's chat rectangle and the other party's chat rectangle, which constitute the message bubble position; wherein, the relationship between the two chat rectangles is defined as follows: if the ratio of the fourth filter value to the third filter value of the rectangle within the second rectangular area is less than a second preset threshold, the rectangle within the second rectangular area is the user's chat rectangle; otherwise, it is the other party's chat rectangle; wherein, the third filter value is the left coordinate of the rectangle within the second rectangular area from the left margin of the instant messaging chat screenshot image; the fourth filter value is the right coordinate of the rectangle within the second rectangular area from the right margin of the instant messaging chat screenshot image. The filtering unit is used to intersect the first region formed by the message bubble position and the second region formed by the text paragraph to obtain the intersecting region; filter out all text paragraphs whose ratio of the fifth filter value to the width of the intersecting region is within a second preset range, wherein the fifth filter value is the difference between the left coordinate of the text paragraph and the left coordinate of the corresponding intersecting region; the filtered text paragraphs are communication text paragraphs, and the text within the communication text paragraphs is a communication record.
6. A device for acquiring communication records based on image recognition, comprising a memory and a processor, characterized in that, The memory stores a computer program that, when executed by the processor, causes the processor to perform the steps of the method as described in any one of claims 1 to 4.
7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it causes the processor to perform the steps of the method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Session identification method and device, readable storage medium and computer equipment
CN115022268A