Content display method and device based on large language model, equipment, storage medium and program product

By obtaining and identifying the identifiers in the style description data generated by the large language model and rendering it, the problem of poor display effects in the existing technology is solved, and rich content display effects are achieved.

CN119557435AActive Publication Date: 2025-03-04BEIJING BAIDU NETCOM SCI & TECH CO LTD

Patent Information

Application Number
CN202411605354.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-11
Publication Date
2025-03-04
Estimated Expiration
2044-11-11

AI Technical Summary

Technical Problem

The prior art is difficult to effectively display content with pictures and texts in applications based on large language models, resulting in poor user experience and insufficient data rendering mechanism for mixed pictures and texts.

Method used

By obtaining the style description data generated based on the large language model, the start and end identifiers in the style description data are identified and rendered based on the subject data to realize the display content with a predetermined style.

Benefits of technology

It realizes the display effect of pictures and texts, improves the richness of content display, and avoids the limitations of traditional plain text output formats.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119557435A_ABST
    Figure CN119557435A_ABST
Patent Text Reader

Abstract

The invention provides a content display method and device based on a large language model, equipment, a storage medium and a program product, and relates to the technical field of artificial intelligence, in particular to the fields of generative artificial intelligence, generative search, large language models and the like. According to the implementation scheme, style description data generated based on a large language model is obtained, and the style description data comprises a first identifier used for indicating the start of the style description data, a second identifier used for indicating the end of the style description data and main body data used for describing a preset style of to-be-displayed content; sequentially identifying the first identifier and the second identifier to determine main body data from the style description data; and performing rendering based on the main body data to obtain display content with a predetermined style.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to the fields of generative artificial intelligence, generative search, and large language models (LLM), and specifically to a content display method based on a large language model, a content display method for mixed text and image layout, a device, an electronic device, a computer-readable storage medium, and a computer program product. Background Art

[0002] Artificial intelligence is a discipline that studies how to use computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.). It includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing; artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, as well as machine learning / deep learning, big data processing technology, knowledge graph technology, and other major directions.

[0003] In recent years, with the development of technologies such as generative artificial intelligence and large language models, users have an increasing demand for the experience of using related products, and they expect to experience more product richness and more optimized visual and perceptual experience. Therefore, there is an urgent need for a response strategy that can provide users with more diverse data and layout styles on the product's interactive interface.

[0004] The methods described in this section are not necessarily methods that have been previously conceived or employed. Unless otherwise indicated, it should not be assumed that any method described in this section is considered to be prior art simply because it is included in this section. Similarly, unless otherwise indicated, the issues mentioned in this section should not be considered to have been recognized in any prior art. Summary of the invention

[0005] The present disclosure provides a content display method based on a large language model, a content display method for mixed text and image layout, an apparatus, an electronic device, a computer-readable storage medium, and a computer program product.

[0006] According to one aspect of the present disclosure, a content display method based on a large language model is provided, comprising: obtaining style description data generated based on the large language model, wherein the style description data includes a first identifier for indicating the start of the style description data and a second identifier for indicating the end of the style description data, and main body data for describing a predetermined style of content to be displayed; identifying the first identifier and the second identifier in sequence to determine the main body data from the style description data; and rendering based on the main body data to obtain display content with a predetermined style.

[0007] According to another aspect of the present disclosure, a content display method for mixed text and graphics is provided, comprising: displaying first text content; displaying graphic content, wherein the graphic content is displayed according to the content display method described above; and displaying second text content.

[0008] According to another aspect of the present disclosure, a content display device based on a large language model is provided, including: an acquisition module, configured to acquire style description data generated based on a large language model, wherein the style description data includes a first identifier for indicating the start of the style description data and a second identifier for indicating the end of the style description data, and main body data for describing a predetermined style of content to be displayed; an identification module, configured to identify the first identifier and the second identifier in sequence to determine the main body data from the style description data; and a rendering module, configured to render based on the main body data to obtain display content having the predetermined style.

[0009] According to another aspect of the present disclosure, there is provided a content display device for mixed text and graphics, comprising: a first text display module, configured to display first text content; a graphic display module, configured to display graphic content, wherein the graphic content is displayed according to the content display device as described above; and a second text display module, configured to display second text content.

[0010] According to another aspect of the present disclosure, an electronic device is provided, comprising at least one processor; and a memory communicatively connected to the at least one processor, wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method as described above.

[0011] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause a computer to execute the method as described above.

[0012] According to another aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein the computer program implements the method described above when executed by a processor.

[0013] According to one or more embodiments of the present disclosure, a display effect of both pictures and texts can be achieved, thereby improving the richness of content display.

[0014] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The accompanying drawings exemplarily illustrate the embodiments and constitute a part of the specification, and together with the text description of the specification, are used to explain the exemplary implementation of the embodiments. The embodiments shown are for illustrative purposes only and do not limit the scope of the claims. In all drawings, the same reference numerals refer to similar but not necessarily identical elements.

[0016] Figure 1 A schematic diagram showing an exemplary system in which various methods described herein may be implemented according to an embodiment of the present disclosure;

[0017] Figure 2 A flowchart of a content display method based on a large language model according to an embodiment of the present disclosure is shown;

[0018] Figure 3 A schematic diagram showing a process of a content display method according to an embodiment of the present disclosure;

[0019] Figure 4 A flowchart showing a process of identifying a first identifier and a second identifier according to an embodiment of the present disclosure;

[0020] Figure 5 A schematic diagram showing style description data according to an embodiment of the present disclosure;

[0021] Figure 6 A schematic diagram showing a predetermined loading waiting pattern to indicate waiting for display content according to an embodiment of the present disclosure is shown;

[0022] Figure 7 A flow chart of a content display method for mixed text and image arrangement according to an embodiment of the present disclosure is shown;

[0023] Figure 8 A schematic diagram showing content mixed with pictures and texts according to an embodiment of the present disclosure is shown;

[0024] Fig. 9 A structural block diagram of a content presentation device based on a large language model according to an embodiment of the present disclosure is shown;

[0025] Fig.10 A structural block diagram of a content presentation device based on a large language model according to another embodiment of the present disclosure is shown;

[0026] Fig.11 A structural block diagram of a content display device for mixed text and image arrangement according to an embodiment of the present disclosure is shown; and

[0027] Fig.12 A structural block diagram of an exemplary electronic device that can be used to implement the embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0028] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0029] In the present disclosure, unless otherwise specified, the use of the terms "first", "second", etc. to describe various elements is not intended to limit the positional relationship, temporal relationship, or importance relationship of these elements, and such terms are only used to distinguish one element from another element. In some examples, the first element and the second element may refer to the same instance of the element, and in some cases, based on the description of the context, they may also refer to different instances.

[0030] The terms used in the description of various examples in this disclosure are only for the purpose of describing specific examples and are not intended to be limiting. Unless the context clearly indicates otherwise, if the number of elements is not specifically limited, the element can be one or more. In addition, the term "and / or" used in this disclosure covers any one of the listed items and all possible combinations.

[0031] In the related art, in applications developed based on large language models, since large language models generally output content based on streaming data, the output content has been fixed in data format, that is, the plain text format commonly used. At present, improvements to this single style may involve mounting certain cards with graphic styles after the text content ends, which are commonly referred to as mounting cards, and are generally placed below the answer bubble. However, this approach still cannot well meet the user experience when using these applications, and the technical implementation does not make good use of the capabilities of the large language model itself. In addition, because the mounting card is located at a specific position at the end of the text content, it may also cause users to regard it as an advertisement and ignore it. At present, there is still a lack of data rendering mechanisms that can effectively display pictures and texts.

[0032] To this end, the embodiments of the present disclosure provide a content display method based on a large language model and a content display method for mixed text and image layout, which can effectively improve the richness of content display.

[0033] Before describing the method of the present invention in detail, Figure 1 Exemplary systems are described in which the methods described herein may be implemented.

[0034] Figure 1FIG. 1 is a schematic diagram of an exemplary system 100 in which various methods and apparatuses described herein may be implemented according to an embodiment of the present disclosure. Figure 1 , the system 100 includes one or more client devices 101, 102, 103, 104, 105, and 106, a server 120, and one or more communication networks 110 coupling the one or more client devices to the server 120. The client devices 101, 102, 103, 104, 105, and 106 may be configured to execute one or more applications.

[0035] In an embodiment of the present disclosure, the server 120 may run one or more services or software applications that enable the content presentation method to be performed.

[0036] In some embodiments, server 120 may also provide other services or software applications, which may include non-virtualized environments and virtualized environments. In some embodiments, these services may be provided as web-based services or cloud services, such as provided to users of client devices 101, 102, 103, 104, 105, and / or 106 under a software as a service (SaaS) model.

[0037] exist Figure 1 In the configuration shown, the server 120 may include one or more components that implement the functions performed by the server 120. These components may include software components, hardware components, or a combination thereof that can be executed by one or more processors. Users operating client devices 101, 102, 103, 104, 105, and / or 106 may in turn utilize one or more client applications to interact with the server 120 to utilize the services provided by these components. It should be understood that a variety of different system configurations are possible, which may differ from the system 100. Therefore, Figure 1 is one example of a system for implementing the various methods described herein and is not intended to be limiting.

[0038] A user may use client devices 101, 102, 103, 104, 105 and / or 106 to access an application developed based on a large language model and interact with the application through a user interface provided in the application. The client device may provide an interface that enables a user of the client device to interact with the client device. The client device may also output information to the user via the interface. Figure 1 Only six client devices are depicted, but one skilled in the art will appreciate that the present disclosure may support any number of client devices.

[0039] Client devices 101, 102, 103, 104, 105 and / or 106 may include various types of computer devices, such as portable handheld devices, general-purpose computers (such as personal computers and laptop computers), workstation computers, wearable devices, smart screen devices, self-service terminal devices, service robots, game systems, thin clients, various messaging devices, sensors or other sensing devices, etc. These computer devices may run various types and versions of software applications and operating systems, such as MICROSOFT Windows, APPLE iOS, UNIX-like operating systems, Linux or Linux-like operating systems (such as GOOGLE Chrome OS); or include various mobile operating systems, such as MICROSOFT Windows Mobile OS, iOS, Windows Phone, Android. Portable handheld devices may include cellular phones, smart phones, tablet computers, personal digital assistants (PDAs), etc. Wearable devices may include head-mounted displays (such as smart glasses) and other devices. Game systems may include various handheld game devices, Internet-enabled game devices, etc. Client devices are capable of executing various different applications, such as various Internet-related applications, communication applications (such as email applications), short message service (SMS) applications, and may use various communication protocols.

[0040] The network 110 may be any type of network known to those skilled in the art that may support data communications using any of a variety of available protocols, including but not limited to TCP / IP, SNA, IPX, etc. By way of example only, the one or more networks 110 may be a local area network (LAN), an Ethernet-based network, a token ring, a wide area network (WAN), the Internet, a virtual network, a virtual private network (VPN), an intranet, an extranet, a blockchain network, a public switched telephone network (PSTN), an infrared network, a wireless network (e.g., Bluetooth, WIFI), and / or any combination of these and / or other networks.

[0041] Server 120 may include one or more general purpose computers, dedicated server computers (e.g., PC (personal computer) servers, UNIX servers, mid-range servers), blade servers, mainframe computers, server clusters, or any other suitable arrangement and / or combination. Server 120 may include one or more virtual machines running virtual operating systems, or other computing architectures involving virtualization (e.g., one or more flexible pools of logical storage devices that may be virtualized to maintain a server's virtual storage device). In various embodiments, server 120 may run one or more services or software applications that provide the functionality described below.

[0042] The computing units in the server 120 may run one or more operating systems including any of the above operating systems and any commercially available server operating systems. The server 120 may also run any of a variety of additional server applications and / or middle-tier applications, including HTTP servers, FTP servers, CGI servers, JAVA servers, database servers, etc.

[0043] In some implementations, server 120 may include one or more applications to analyze and consolidate data feeds and / or event updates received from users of client devices 101, 102, 103, 104, 105, and / or 106. Server 120 may also include one or more applications to display data feeds and / or real-time events via one or more display devices of client devices 101, 102, 103, 104, 105, and / or 106.

[0044] In some embodiments, the server 120 may be a server of a distributed system, or a server combined with a blockchain. The server 120 may also be a cloud server, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology. A cloud server is a host product in a cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and virtual private servers (VPS) services.

[0045] The system 100 may also include one or more databases 130. In some embodiments, these databases may be used to store data and other information. For example, one or more of the databases 130 may be used to store information such as audio files and video files. The databases 130 may reside in various locations. For example, the database used by the server 120 may be local to the server 120, or may be remote from the server 120 and may communicate with the server 120 via a network-based or dedicated connection. The databases 130 may be of different types. In some embodiments, the databases used by the server 120 may be, for example, relational databases. One or more of these databases may store, update, and retrieve data to and from the databases in response to commands.

[0046] In some embodiments, one or more of the databases 130 may also be used by applications to store application data. The databases used by the applications may be different types of databases, such as a key-value store, an object store, or a conventional store backed by a file system.

[0047] Figure 1The system 100 may be configured and operated in various ways to enable the application of the various methods described in accordance with the present disclosure.

[0048] Various aspects of a content display method based on a large language model and a content display method for mixed text and image layout according to an embodiment of the present disclosure will be described in detail below with reference to the accompanying drawings.

[0049] Figure 2 A flowchart of a content presentation method 200 based on a large language model according to an embodiment of the present disclosure is shown.

[0050] like Figure 2 As shown, method 200 includes steps S201, S202 and S203.

[0051] In step S201, style description data generated based on a large language model is obtained. The style description data includes a first identifier for indicating the start of the style description data and a second identifier for indicating the end of the style description data, as well as body data for describing a predetermined style of content to be displayed.

[0052] In the example, the style description data can be defined and expressed by a DSL (Domain Specific Language). DSL is a programming language designed for a specific application domain or a specific problem. It is simpler and easier to use than a general programming language because it focuses on a specific problem domain. DSL can be used to define a specific set of instructions for indicating how to render a predetermined style of the content to be displayed. Accordingly, DSL may include a start tag DSL start , end tag DSL end and language type DSL lang , which is used to insert specific structured data, graphics or rich media (such as videos, web page links) obtained by rendering into the streaming data generated by the large language model, that is, the text paragraphs returned by the large language model. Therefore, the DSL is marked start It may correspond to the first identifier used to indicate the start of the style description data, and the end marker DSL end May correspond to a second identifier used to indicate the end of the style description data.

[0053] In the example, a prompt can be used to inform the large language model about the slot where the DSL needs to be inserted, that is, where it is located in the text paragraph returned by the large language model. That is, the slot can be predefined to ensure that the content to be displayed can be rendered in the expected manner. Accordingly, the body data can be located between the first identifier and the second identifier to specify complex rendering logic in a declarative manner, so the predetermined style of the content to be displayed needs to be described in detail.

[0054] In the example, the style description data may be in the form of SVG (Scalable Vector Graphics) code. SVG is a vector graphics format based on XML (Extensive Markup Language) that can be used to describe two-dimensional graphics and vector graphics. The required SVG code can be generated by providing a prompt using a large language model. For example, a predetermined style of the content to be displayed, such as the color, shape, background, style, text in the graphics, etc., of the graphics can be described in natural language in the prompt. The large model can then output the SVG code corresponding to the prompt, that is, the predetermined style of the content to be displayed is described in the form of SVG code, so that the SVG code can be converted into a corresponding graphic through rendering.

[0055] In step S202, the first identifier and the second identifier are identified in sequence to determine the body data from the style description data.

[0056] In an example, the first identifier and the second identifier may be pre-agreed specific characters or have a pre-agreed format, so that they can be identified during the process of parsing the style description data generated by the large language model.

[0057] In the example, since the main body data may be located between the first identifier and the second identifier, after the first identifier and the second identifier are identified, the data located between the first identifier and the second identifier in the style description data may be cut to obtain the main body data.

[0058] In step S203, rendering is performed based on the main body data to obtain display content with a predetermined style.

[0059] In the example, the predetermined style of the content to be displayed can involve various complex typesetting styles according to actual business needs, such as mixed text and image layout, structured data layout, etc., in order to achieve a content display effect with both pictures and text. And this is achieved through rendering, that is, rendering refers to converting data into visible or visual content on the interactive interface for display. The rendering mentioned in the embodiment of the present disclosure can also be called delayed rendering. This is because when inserting the rendered content into a specific position of the text paragraph returned by the large language model, there is a certain amount of time and waiting from the user's perspective, thus forming a delay, so it is called delayed rendering.

[0060] Therefore, in the content display method 200 according to the embodiment of the present disclosure, a large language model can be used to generate style description data for specifying complex rendering logic, and during parsing, the rendering timing can be accurately determined by identifying the first identifier and the second identifier that can represent the start and end of the style description data, thereby inserting the rendered content at a specific position in the output result of the large language model to achieve a graphic and text display effect, thereby effectively improving the richness of content display in applications developed based on the large language model.

[0061] Figure 3 A schematic diagram showing the process of the content display method according to an embodiment of the present disclosure is shown.

[0062] like Figure 3 As shown, the large language model 301 can generate style description data 310, which can include a first identifier, a second identifier, and main data 310'. Figure 2 The parser 302 may obtain the style description data 310 from the large language model 301, and sequentially identify the first identifier and the second identifier to determine the main body data 310' from the style description data 310. After the parser 302 determines the main body data 310', the main body data 310' may be sent to the renderer 303, so that the renderer 303 may render based on the main body data 310' to obtain a rendering result 320 with a predetermined style and return it to the parser 302 as display content.

[0063] Figure 4 A flow chart of a process 400 of identifying a first identifier and a second identifier according to an embodiment of the present disclosure is shown.

[0064] In some embodiments, the first identifier and the second identifier may each include a plurality of consecutive and identical sub-identifiers. Figure 4 The process 400 shown is as follows Figure 2 The step S202 shown sequentially identifies the first identifier and the second identifier to determine the main body data from the style description data, and may further include steps S401, S402 and S403. In step S401, the last sub-identifier among the multiple consecutive and identical sub-identifiers identified for the first time is determined as the first index. In step S402, the first sub-identifier among the multiple consecutive and identical sub-identifiers identified for the second time is determined as the second index. In step S403, the data between the first index and the second index in the style description data is determined as the main body data.

[0065] In the example, in the case where the data is described by the DSL definition style, you can define "DSL start :∫∫∫" and "DSL endThat is, the first identifier and the second identifier may each include three consecutive and identical sub-identifiers “∫∫∫”.

[0066] In the example, the text provided by the large language model to the parser is printed word by word, that is, data is divided into chunks. Therefore, the parser needs to determine word by word whether it reaches the first identifier DSL start Assume that the character currently being printed has an index of i (i is an integer greater than or equal to 1). If the characters with indexes [i, i+1, i+2] are all “∫”, then the i-th character is marked as the first index. start ; Then, if the characters with subscripts [i-1,i,i+1] are all "∫", then mark the i-th character as the first index Index start , and clear the i-1th character from the screen; then, if the characters with subscripts [i-2,i-1,i] are all "∫", mark the i-th character as the first index Index start , and clear the i-1th character and the i-2th character. Thus, three consecutive and identical sub-identifiers "∫∫∫" can be identified for the first time, and the last sub-identifier among the three can be determined as the first index Index start Similarly, the parser also needs to determine word by word whether it has reached the second identifier DSL end。 If three consecutive and identical sub-identifiers "∫∫∫" are recognized for the second time, it means that the characters with subscripts [i-2,i-1,i] are all "∫" again, then the i-2th character can be marked as the second index Index end On this basis, we can cut out [Index start ,Index end ] to identify them as main data.

[0067] In the example, upon reaching the first identifier DSL start But the second identifier DSL is not reached end Previously, the parser could continue to wait and record and store all the characters received during this period, i.e., local accumulation.

[0068] In the above manner, by means of the first identifier and the second identifier set in a specific manner, the slot set for the content to be rendered can be accurately identified to extract the corresponding data, thereby facilitating the display effect of both pictures and texts.

[0069] Figure 5 A schematic diagram of style description data 500 according to an embodiment of the present disclosure is shown.

[0070] like Figure 5As shown, the style description data 500 may include a first identifier 501, a second identifier 502, and main body data 503. The first identifier 501 indicates the start of the style description data 500, and the second identifier 502 indicates the end of the style description data 500. Thus, the slot to be inserted into the content to be rendered can be predefined. The main body data 503 is located between the first identifier 501 and the second identifier 502 in the style description data 500.

[0071] The first identifier 501 and the second identifier 502 may include three consecutive and identical sub-identifiers “∫∫∫”. The main data 503 may be used to describe a predetermined style of the content to be displayed to indicate how to render. Figure 5 In the illustrated embodiment, the style description data 500 is in the form of SVG code, which may include the definition of the color, shape, background, style, text in the graphic, etc. It is understandable that Figure 5 The SVG codes shown in are examples for illustration purposes only and are not intended to limit the scope of the present disclosure.

[0072] In some embodiments, the subject data may have a corresponding data type. Figure 2 The step S203 shown is to render based on the main body data to obtain display content with a predetermined style, which may include: performing rendering based on the data type of the main body data.

[0073] In the example, where the data is described by a DSL, the language type DSL can be defined lang =query, DSL lang =markdown, DSL lang =html, DSL lang =iframe, etc. That is, the data type of the body data may correspond to a query type, a lightweight markup language (markdown) type, a hypertext markup language (html) type, an inline frame (iframe) type, etc.

[0074] Therefore, by performing rendering based on the data type of the main data, the expected rendering effect can be provided accurately and effectively, which helps to provide the best rendering strategy for various special business data and improve the universality of the overall method.

[0075] In some embodiments, performing rendering based on the data type of the main data may include: in response to the data type of the main data corresponding to the query type, parsing from the main data to obtain a key-value (KV) pair; obtaining data to be rendered associated with the KV pair; and performing rendering based on the data to be rendered.

[0076] For DSL lang =query, an example of style description data may be:

[0077] ∫∫∫query

[0078] page=1&pagesize=10

[0079] ∫∫∫

[0080] In this case, the parser can parse the KV pair from the main body data, and obtain the data to be rendered from the JSON (JavaScript Object Notation) data returned by the server and send it to the renderer, so that the renderer can perform rendering for the query type. In this way, an adaptive rendering strategy can be provided for rendering scenarios applicable to the query type.

[0081] In some embodiments, performing rendering based on the data type of the body data may include: in response to the data type of the body data corresponding to the markdown type or the html type, performing rendering based on a description of a predetermined style of content to be displayed in the body data.

[0082] For DSL lang = In the case of markdown, an example of style description data may be:

[0083] ∫∫∫markdown

[0084] ##Images

[0085] ! [Minion](https: / / octodex.github.com / images / minion.png)

[0086] ∫∫∫

[0087] For DSL lang = html, an example of style description data may be:

[0088] ∫∫∫html

[0089] This is a web page

[0090] ∫∫∫

[0091] In this case, after parsing the body data, the parser can send it to the renderer, so that the renderer can perform markdown or html type rendering (for html type, security processing can also be performed). Thus, an adaptive rendering strategy can be provided for the rendering scenarios applicable to markdown or html types.

[0092] In some embodiments, performing rendering based on the data type of the body data may include: in response to the data type of the body data corresponding to the iframe type, mounting a page included in the body data to perform rendering.

[0093] For DSL lang = In the case of iframe, an example of style description data may be:

[0094] ∫∫∫iframe

[0095] <iframe src="http: www.baidu.com”>< / iframe>

[0096] ∫∫∫

[0097] In this case, after parsing and obtaining the main body data, the parser can mount the page included in the main body data, thereby providing an adaptive rendering strategy for the rendering scenario applicable to the iframe type.

[0098] In some embodiments, such as in combination Figure 2 The step S203 shown is rendering based on the main data to obtain display content with a predetermined style, which may include: creating a document object model (DOM) element for the content to be displayed; generating a unique identity for the DOM element; and based on the unique identity, rendering the main data in the DOM element to obtain display content with a predetermined style.

[0099] Since DOM elements can provide a structured way to organize and represent content, it is convenient to use DOM elements to render data, thereby achieving precise visual effects.

[0100] In some embodiments, such as in combination Figure 2 The method 200 shown may further include: after the first identifier is identified and before the second identifier is identified, displaying a predetermined loading waiting style to indicate waiting for displaying the content.

[0101] In the example, as described above, upon reaching the first identifier DSL start But the second identifier DSL is not reached end When the rendering process is in progress, local accumulation can be performed. Since this process takes a certain amount of time, the user can be prompted to perform a rendering process in the background by displaying a predetermined loading waiting style. lang Different styles of loading effects are provided by different methods.

[0102] In this way, users can be given appropriate prompts while waiting for delayed rendering, and the visual effect can also be improved to alleviate users' waiting anxiety.

[0103] Figure 6 A schematic diagram is shown of displaying a predetermined loading waiting pattern to indicate waiting for display content according to an embodiment of the present disclosure.

[0104] like Figure 6 As shown, a predetermined loading waiting style 600 is shown to indicate waiting for the displayed content, that is, a picture of a tiger with light yellow or brown fur and black stripes is about to be displayed in the interactive interface, so as to provide a graphic and textual answer to the question raised by the user, "What does a tiger look like?" It can be understood that the loading waiting style 600 can be designed in various ways according to actual applications, and is not limited to the following. Figure 6 shown.

[0105] According to an embodiment of the present disclosure, a content display method for mixed text and image layout is also provided.

[0106] Figure 7 A flowchart of a content display method 700 for mixed text and image layout according to an embodiment of the present disclosure is shown.

[0107] like Figure 7 As shown, method 700 includes steps S701, S702 and S703. In step S701, the first text content is displayed. In step S702, the graphic content is displayed, and the graphic content is displayed according to the content display method described above. In step S703, the second text content is displayed.

[0108] In the example, the mixed text and graphics mentioned in this article may refer to a complex layout formed by plain text content and content such as structured data, graphics or rich media, which can provide a visual richness of both text and graphics.

[0109] In the example, the first text content and the second text content may be plain text content returned by the large language model, and the graphic content may be structured data, graphics, or rich media rendered according to the content display method of the embodiment of the present disclosure. Therefore, the graphic content may be a fragment that is rendered in a delayed manner according to the needs of the embodiment of the present disclosure. In actual applications, there may be multiple fragments that need to be rendered in a delayed manner according to scenes of different complexities, so they can be rendered in sequence from top to bottom according to the above logic.

[0110] Through the above method, a display style with a special rendering effect can be inserted at a specific position in the text paragraph returned by the large language model, thereby achieving a display effect with both pictures and texts, avoiding the limitation of the traditional method that can only rely on the pure text output format of the large language model, and thus effectively improving the richness of content display in applications developed based on the large language model.

[0111] Figure 8 A schematic diagram of displaying mixed text and image content according to an embodiment of the present disclosure is shown.

[0112] like Figure 8 As shown, a first text content 801, a graphic content 810, a second text content 802 and a graphic content 820 are displayed on the interactive interface, wherein the first text content 801 and the second text content 802 are pure text contents returned by the large language model, and the graphic content 810 and the graphic content 820 are special cards rendered according to the content display method of an embodiment of the present disclosure.

[0113] According to an embodiment of the present disclosure, a content presentation device based on a large language model is also provided.

[0114] Fig. 9 A structural block diagram of a content presentation device 900 based on a large language model according to an embodiment of the present disclosure is shown.

[0115] like Fig. 9 As shown, the device 900 includes an acquisition module 901 , a recognition module 902 and a rendering module 903 .

[0116] The acquisition module 901 is configured to acquire style description data generated based on a large language model, wherein the style description data includes a first identifier for indicating the start of the style description data and a second identifier for indicating the end of the style description data, as well as body data for describing a predetermined style of content to be displayed.

[0117] The identification module 902 is configured to identify the first identifier and the second identifier in sequence to determine the body data from the style description data.

[0118] The rendering module 903 is configured to perform rendering based on the main body data to obtain display content with a predetermined style.

[0119] The operations of the acquisition module 901, the identification module 902 and the rendering module 903 may correspond to the following: Figure 2 Therefore, the details of each aspect are not repeated here.

[0120] Fig.10A structural block diagram of a content presentation device 1000 based on a large language model according to another embodiment of the present disclosure is shown.

[0121] like Fig.10 As shown, the apparatus 1000 may include an acquisition module 1001, an identification module 1002, and a rendering module 1003. The operations of the above modules may be similar to those of Fig. 9 The operations of the acquisition module 901, the identification module 902 and the rendering module 903 are the same. In addition, the above modules may also include further sub-modules.

[0122] In some embodiments, the first identifier and the second identifier both include a plurality of consecutive and identical sub-identifiers. The identification module 1002 may include a start identification module 1002a, configured to determine the last sub-identifier among the plurality of consecutive and identical sub-identifiers identified for the first time as the first index; an end identification module 1002b, configured to determine the first sub-identifier among the plurality of consecutive and identical sub-identifiers identified for the second time as the second index; and a data cutting module 1002c, configured to determine the data between the first index and the second index in the style description data as the main body data.

[0123] In some embodiments, the subject data has a corresponding data type. The rendering module 1003 may include: a type rendering module 1003a configured to perform rendering based on the data type of the subject data.

[0124] In some embodiments, the type rendering module 1003a may include a first parsing module 1003a-1, configured to parse the main data to obtain a key-value pair in response to the data type of the main data corresponding to the query type; a first data acquisition module 1003a-2, configured to obtain the data to be rendered associated with the key-value pair; and a first rendering module 1003a-3, configured to perform rendering based on the data to be rendered.

[0125] In some embodiments, the type rendering module 1003a may include a second rendering module 1003a-4, which is configured to perform rendering based on a description of a predetermined style of content to be displayed in the body data in response to the data type of the body data corresponding to a lightweight markup language type or a hypertext markup language type.

[0126] In some embodiments, the type rendering module 1003a may include a third rendering module 1003a-5 configured to mount a page included in the body data in response to the data type of the body data corresponding to the inline frame type.

[0127] In some embodiments, the rendering module 1003 may include an element creation module 1003b, configured to create a document object model element for the content to be displayed; an identifier generation module 1003c, configured to generate a unique identifier for the document object model element; and a rendering execution module 1003d, configured to render the main data in the document object model element based on the unique identifier to obtain display content with a predetermined style.

[0128] In some embodiments, the apparatus 1000 may further include a loading waiting module 1004 configured to display a predetermined loading waiting pattern to indicate waiting for displaying content after the first identifier is identified and before the second identifier is identified.

[0129] Fig.11 A structural block diagram of a content display device 1100 for mixed text and image layout according to an embodiment of the present disclosure is shown.

[0130] like Fig.11 As shown, the device 1100 may include a first text display module 1101, a graphic display module 1102, and a second text display module 1103. The first text display module 1101 is configured to display a first text content. The graphic display module 1102 is configured to display a graphic content, wherein the graphic content is displayed according to the content display device as described above. The second text display module 1103 is configured to display a second text content.

[0131] The operations of the first text display module 1101, the graphic display module 1102 and the second text display module 1103 may correspond to the following: Figure 7 Therefore, the details of each aspect thereof will not be repeated here.

[0132] According to an embodiment of the present disclosure, an electronic device is also provided, comprising at least one processor; and a memory communicatively connected to the at least one processor, wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method as described above.

[0133] According to an embodiment of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is also provided, wherein the computer instructions are used to enable a computer to execute the method as described above.

[0134] According to an embodiment of the present disclosure, a computer program product is also provided, including a computer program, wherein the computer program implements the method as described above when executed by a processor.

[0135] refer to Fig.12, a block diagram of an electronic device 1200 that can be used as a server or client of the present disclosure will now be described, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0136] like Fig.12 As shown, the electronic device 1200 includes a computing unit 1201, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1202 or a computer program loaded from a storage unit 1208 into a random access memory (RAM) 1203. In the RAM 1203, various programs and data required for the operation of the electronic device 1200 can also be stored. The computing unit 1201, the ROM 1202, and the RAM 1203 are connected to each other via a bus 1204. An input / output (I / O) interface 1205 is also connected to the bus 1204.

[0137] Multiple components in the electronic device 1200 are connected to the I / O interface 1205, including: an input unit 1206, an output unit 1207, a storage unit 1208, and a communication unit 1209. The input unit 1206 can be any type of device that can input information to the electronic device 1200. The input unit 1206 can receive input digital or character information, and generate key signal input related to user settings and / or function control of the electronic device, and can include but is not limited to a mouse, a keyboard, a touch screen, a track pad, a track ball, a joystick, a microphone, and / or a remote controller. The output unit 1207 can be any type of device that can present information, and can include but is not limited to a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The storage unit 1208 can include but is not limited to a disk and an optical disk. The communication unit 1209 allows the electronic device 1200 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks, and may include but is not limited to a modem, a network card, an infrared communication device, a wireless communication transceiver and / or a chipset, such as a Bluetooth device, an 802.11 device, a WiFi device, a WiMax device, a cellular communication device and / or the like.

[0138] The computing unit 1201 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 1201 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 1201 performs the various methods and processes described above. For example, in some embodiments, the method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 1208. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 1200 via ROM 1202 and / or a communication unit 1209. When the computer program is loaded into RAM 1203 and executed by the computing unit 1201, one or more steps of the method described above may be performed. Alternatively, in other embodiments, the computing unit 1201 may be configured to perform the method described above in any other appropriate manner (e.g., by means of firmware).

[0139] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0140] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0141] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0142] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0143] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), the Internet, and a blockchain network.

[0144] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0145] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0146] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0147] Although the embodiments or examples of the present disclosure have been described with reference to the accompanying drawings, it should be understood that the above-mentioned methods, systems and devices are merely exemplary embodiments or examples, and the scope of the present invention is not limited by these embodiments or examples, but only by the claims after authorization and their equivalent scope. Various elements in the embodiments or examples can be omitted or replaced by their equivalent elements. In addition, each step can be performed in an order different from that described in the present disclosure. Further, the various elements in the embodiments or examples can be combined in various ways. It is important that with the evolution of technology, many elements described herein can be replaced by equivalent elements that appear after the present disclosure.

Claims

1. A content display method based on a large language model, comprising: Acquire style description data generated based on a large language model, wherein the style description data includes a first identifier for indicating the start of the style description data and a second identifier for indicating the end of the style description data, and body data for describing a predetermined style of content to be displayed; identifying the first identifier and the second identifier in sequence to determine the body data from the style description data; and Rendering is performed based on the main body data to obtain display content with the predetermined style.

2. The method according to claim 1, wherein: The first identifier and the second identifier each include a plurality of consecutive and identical sub-identifiers, wherein the step of sequentially identifying the first identifier and the second identifier to determine the subject data from the style description data includes: Determine the last sub-identifier among the plurality of consecutive and identical sub-identifiers identified for the first time as a first index; Determine the first sub-identifier among the plurality of consecutive and identical sub-identifiers identified for the second time as a second index; and The data between the first index and the second index in the style description data is determined as the main body data.

3. The method according to claim 1 or 2, wherein: The main body data has a corresponding data type, wherein rendering based on the main body data to obtain display content with the predetermined style includes: The rendering is performed based on the data type of the body data.

4. The method according to claim 3, wherein: The performing the rendering based on the data type of the main data includes: In response to the data type of the main body data corresponding to the query type, parsing the main body data to obtain a key-value pair; Obtaining the data to be rendered associated with the key-value pair; and The rendering is performed based on the to-be-rendered data.

5. The method according to claim 3, wherein: The performing the rendering based on the data type of the main data includes: In response to the data type of the body data corresponding to a lightweight markup language type or a hypertext markup language type, the rendering is performed based on the description of the predetermined style of the to-be-displayed content in the body data.

6. The method according to claim 3, wherein: The performing the rendering based on the data type of the main data includes: In response to the data type of the body data corresponding to an iframe type, a page included in the body data is mounted.

7. The method according to any one of claims 1 to 6, wherein: The rendering based on the main body data to obtain display content having the predetermined style includes: Creating a document object model element for the content to be displayed; Generating a unique identifier for the document object model element; and Based on the unique identification, the body data is rendered in the document object model element to obtain the display content with the predetermined style.

8. The method according to any one of claims 1 to 7, wherein: The method further includes: after identifying the first identifier and before identifying the second identifier, displaying a predetermined loading waiting pattern to indicate waiting for the display content.

9. A method for displaying content for mixed text and image layout, comprising: Display the first text content; Displaying graphic content, wherein the graphic content is displayed according to the content display method according to any one of claims 1 to 8; as well as Display the second text content.

10. A content display device based on a large language model, comprising: an acquisition module configured to acquire style description data generated based on a large language model, wherein the style description data includes a first identifier for indicating the start of the style description data and a second identifier for indicating the end of the style description data, and body data for describing a predetermined style of content to be displayed; an identification module configured to identify the first identifier and the second identifier in sequence to determine the body data from the style description data; and The rendering module is configured to perform rendering based on the main data to obtain display content with the predetermined style.

11. The device according to claim 10, wherein: The first identifier and the second identifier both include a plurality of consecutive and identical sub-identifiers, wherein the identification module includes: a start identification module, configured to determine the last sub-identifier among the plurality of consecutive and identical sub-identifiers identified for the first time as a first index; an end identification module, configured to determine the first sub-identifier among the plurality of consecutive and identical sub-identifiers identified for the second time as a second index; and The data cutting module is configured to determine the data between the first index and the second index in the style description data as the main body data.

12. The device according to claim 10 or 11, wherein: The main body data has a corresponding data type, wherein the rendering module includes: A type rendering module is configured to perform the rendering based on the data type of the main data.

13. The device according to claim 12, wherein: The type rendering module includes: A first parsing module is configured to parse the main body data to obtain a key-value pair in response to the data type of the main body data corresponding to a query type; A first data acquisition module is configured to acquire the to-be-rendered data associated with the key-value pair; and The first rendering module is configured to perform the rendering based on the data to be rendered.

14. The device according to claim 12, wherein: The type rendering module includes: The second rendering module is configured to, in response to the data type of the main body data corresponding to a lightweight markup language type or a hypertext markup language type, perform the rendering based on the description of the predetermined style of the to-be-displayed content in the main body data.

15. The device according to claim 12, wherein: The type rendering module includes: The third rendering module is configured to mount a page included in the body data in response to the data type of the body data corresponding to an inline frame type.

16. The device according to any one of claims 10 to 15, wherein: The rendering module includes: An element creation module, configured to create a document object model element for the content to be displayed; an identification generation module, configured to generate a unique identification for the document object model element; and The rendering execution module is configured to render the main body data in the document object model element based on the unique identity to obtain the display content with the predetermined style.

17. The device according to any one of claims 10 to 16, wherein: The device further includes: a loading waiting module configured to display a predetermined loading waiting pattern to indicate waiting for the displayed content after the first identifier is identified and before the second identifier is identified.

18. A content display device for mixed text and image layout, comprising: A first text display module is configured to display a first text content; A graphic display module, configured to display graphic content, wherein the graphic content is displayed according to the content display device according to any one of claims 10 to 17; as well as The second text display module is configured to display the second text content.

19. An electronic device comprising: at least one processor; as well as a memory communicatively coupled to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method according to any one of claims 1-9.

20. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to make a computer execute the method according to any one of claims 1-9.

21. A computer program product comprising a computer program, wherein: The computer program implements the method according to any one of claims 1 to 9 when executed by a processor.

Citation Information

Patent Citations

  • Large model image-text dialogue method and device, equipment and storage medium

    CN117633173A

  • Resource processing design method and device based on large language model and computer equipment

    CN118154726A

  • Sports data news generation system based on big language model

    CN118395948A

  • System, method, and apparatus for storing, transmitting, receiving, and using structured data using un-structured text message bodies

    US20130095864A1

  • Style-based dynamic content generation

    US20230154082A1

Cited By

  • Intelligent image-text integrated processing system and method

    CN120633589A

  • Intelligent image-text integrated processing system and method

    CN120633589B

  • Page rendering method and device based on large model, electronic equipment and medium

    CN120780397A