CN113032700B - Natural language data rendering and website optimizing method, system, equipment and medium - Google Patents

Natural language data rendering and website optimizing method, system, equipment and medium Download PDF

Info

Publication number
CN113032700B
CN113032700B CN202110259839.7A CN202110259839A CN113032700B CN 113032700 B CN113032700 B CN 113032700B CN 202110259839 A CN202110259839 A CN 202110259839A CN 113032700 B CN113032700 B CN 113032700B
Authority
CN
China
Prior art keywords
natural language
language data
nodes
character string
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110259839.7A
Other languages
Chinese (zh)
Other versions
CN113032700A (en
Inventor
贾高胜
刘瑞
崔广宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ctrip Computer Technology Shanghai Co Ltd
Original Assignee
Ctrip Computer Technology Shanghai Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ctrip Computer Technology Shanghai Co Ltd filed Critical Ctrip Computer Technology Shanghai Co Ltd
Priority to CN202110259839.7A priority Critical patent/CN113032700B/en
Publication of CN113032700A publication Critical patent/CN113032700A/en
Application granted granted Critical
Publication of CN113032700B publication Critical patent/CN113032700B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention discloses a method, a system, equipment and a medium for rendering natural language data and optimizing websites. The natural language data rendering method comprises the following steps: constructing a structured character string of natural language, wherein the structured character string comprises nodes, variables and preset fixed character strings; the preset fixed character string comprises a separation symbol and a connective; judging whether natural language data corresponding to the variable exist or not, if so, acquiring the natural language data, replacing the variable with the natural language data, and if not, stopping replacing the variable with the data; traversing the natural language data, judging whether the natural language data needs to separate symbols and/or connective words, if yes, adding separation symbol character strings and/or connective word character strings of node identifiers between the natural language data, and rendering, otherwise, directly rendering the natural language data; and selecting fixed character strings corresponding to the number of the node identifiers according to the number of the natural language data for rendering. This method ensures semantic consistency.

Description

Natural language data rendering and website optimizing method, system, equipment and medium
Technical Field
The present invention relates to the field of natural language processing technologies, and in particular, to a method, a system, an apparatus, and a medium for rendering natural language data and optimizing a website.
Background
The template engine is an algorithm implementation for converting the template codes with the specified format into the service data with the aim of separating the service data from the user interface, and generates documents with the specific format for rendering the service data, so that the development efficiency is improved. When processing natural language, the existing template engine analyzes the natural language character string and performs corresponding data rendering according to specific variables in the natural language character string. The existing template engine cannot guarantee semantic consistency and no ambiguity when rendering data in multiple natural languages. If some variables are lost, rendering data according to the variables can lead to blank display, so that the expression is incorrect; rendering data in different natural languages, a great deal of manpower is required to be expended to adjust the sequence of the corresponding character strings to correspond to the word sequences in different natural languages, otherwise, word sequence inversion occurs, and the use habit is not met. A number of similar situations can reduce the user's use experience, as well as reduce the website SEO (Search Engine Optimal) ranking.
Disclosure of Invention
The invention aims to overcome the defect that semantic consistency cannot be guaranteed or ambiguity cannot be generated when the existing template engine is used for rendering data of multiple natural languages in the prior art, and provides a method, a system, equipment and a medium for rendering data of the natural languages and optimizing websites.
The invention solves the technical problems by the following technical scheme:
the invention provides a natural language data rendering method, which comprises the following steps:
constructing a structured character string of natural language, wherein the structured character string comprises nodes, variables and preset fixed character strings;
the node is used for identifying the variable and the fixed character string;
the preset fixed character string corresponds to the fixed expression of the natural language;
the preset fixed character string comprises a separation symbol and a connective;
judging whether natural language data corresponding to the variable exist or not, if so, acquiring the natural language data, replacing the variable with the natural language data, and if not, stopping data replacement of the variable;
traversing the natural language data, judging whether the natural language data needs separation symbols and/or connective words, if yes, adding separation symbol character strings and/or connective word character strings of the node identifiers between the natural language data, and rendering, otherwise, directly rendering the natural language data;
and selecting fixed character strings corresponding to the number of the node identifiers according to the number of the natural language data to render so as to obtain target character strings running on a user interface.
Preferably, the nodes include phrase nodes, separator nodes, connector nodes, singular nodes and plural nodes;
the phrase node is used for identifying a character string comprising the variable;
the separation node is used for identifying a separation symbol character string of the natural language;
the connection node is used for identifying a connection word character string of the natural language;
the singular node is used for identifying fixed character strings corresponding to singular nouns of the natural language data;
the plurality of nodes are used for identifying fixed character strings corresponding to a plurality of nouns of the natural language data;
and/or the number of the groups of groups,
the fixed expression of the natural language comprises words, phrases and punctuation marks of the natural language;
and/or the number of the groups of groups,
the natural language includes a plurality of international languages.
Preferably, the phrase nodes, the separator nodes, the connector nodes, the singular nodes, and the plural nodes are arranged according to the natural language order.
Preferably, the step of determining whether the natural language data requires separation of symbols or connective includes:
counting the number of the natural language data;
if the number of the natural language data is 1, judging that the natural language data does not need separation symbols or connective words;
if the number of the natural language data is 2, judging that the natural language data needs a connecting word and does not need a separation symbol;
if the number of the natural language data is greater than or equal to 3, judging that the natural language data needs a connective and at least one separation symbol.
The invention also provides an OTA (Online Travel Agency ) website SEO ranking optimization method, which comprises the following steps:
acquiring data corresponding to the variable of the OTA website;
obtaining a target character string corresponding to the natural language of the OTA website by using the natural language data rendering method;
and the front end of the OTA website executes the target character string.
The invention also provides a natural language data rendering system, which comprises:
the system comprises a structured character string construction module, a storage module and a storage module, wherein the structured character string construction module is used for constructing a structured character string of natural language, and the structured character string comprises nodes, variables and preset fixed character strings;
the node is used for identifying the variable and the fixed character string;
the preset fixed character string corresponds to the fixed expression of the natural language;
the preset fixed character string comprises a separation symbol and a connective;
the data acquisition module is used for judging whether natural language data corresponding to the variable exist or not, if yes, acquiring the natural language data, replacing the variable with the natural language data, and if not, stopping data replacement for the variable;
the data processing module is used for traversing the natural language data, judging whether the natural language data need separating symbols and/or connecting words, if yes, adding separating symbol character strings and/or connecting word character strings of the node identifiers between the natural language data, and rendering, otherwise, directly rendering the natural language data;
and the fixed character string processing module is used for selecting fixed character strings corresponding to the number of the node identifiers or fixed character strings corresponding to a plurality of nouns according to the number of the natural language data to render so as to obtain target character strings running on a user interface.
Preferably, the nodes include phrase nodes, separator nodes, connector nodes, singular nodes and plural nodes;
the phrase node is used for identifying a character string comprising the variable;
the separation node is used for identifying a separation symbol character string of the natural language;
the connection node is used for identifying a connection word character string of the natural language;
the singular node is used for identifying fixed character strings corresponding to singular nouns of the natural language data;
the plurality of nodes are used for identifying fixed character strings corresponding to a plurality of nouns of the natural language data;
and/or the number of the groups of groups,
the fixed expression of the natural language comprises words, phrases and punctuation marks of the natural language;
and/or the number of the groups of groups,
the natural language includes a plurality of international languages.
Preferably, the phrase nodes, the separator nodes, the connector nodes, the singular nodes, and the plural nodes are arranged according to the natural language order.
Preferably, the data processing module is further configured to count the number of the natural language data;
if the number of the natural language data is 1, judging that the natural language data does not need separation symbols or connective words;
if the number of the natural language data is 2, judging that the natural language data needs a connecting word and does not need a separation symbol;
and if the number of the natural language data is greater than or equal to 3, judging that the natural language data needs a connective and at least one separation symbol.
The invention also provides an OTA website SEO ranking optimization system, which comprises:
the website data acquisition module is used for acquiring data corresponding to the variable of the OTA website;
the data rendering module is used for obtaining a target character string corresponding to the natural language of the OTA website by utilizing the natural language data rendering system;
and the character string execution module is used for executing the target character string.
The invention also provides an electronic device comprising a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor realizes the natural language data rendering method or the OTA website SEO ranking optimization method when executing the computer program.
The invention also provides a computer readable storage medium having stored thereon a computer program which when executed by a processor implements a natural language data rendering method as described above or an OTA website SEO ranking optimization method as described above.
The invention has the positive progress effects that:
according to the invention, the natural language character string is structured by utilizing the node to mark the variable and the fixed character string of the natural language, the words, phrases and punctuation marks which are fixedly used are marked by different nodes, and the proper fixed character string is called by the nodes according to the quantity of the natural language data, so that when the data of the variable is lost, the variable can be normally rendered without ambiguity, the consistency of the semantics is ensured, and the browsing experience of a user is improved.
Drawings
Fig. 1 is a flowchart of a natural language data rendering method according to embodiment 1 of the present invention.
Fig. 2 is a flowchart of an optimization method for the SEO ranking of the OTA website according to embodiment 2 of the present invention.
Fig. 3 is a block diagram illustrating a natural language data rendering system according to embodiment 3 of the present invention.
Fig. 4 is a block diagram of an OTA website SEO ranking optimization system according to embodiment 4 of the present invention.
Fig. 5 is a schematic hardware structure of an electronic device according to embodiment 5 of the present invention.
Detailed Description
The invention is further illustrated by means of the following examples, which are not intended to limit the scope of the invention.
Example 1
As shown in fig. 1, the present embodiment provides a natural language data rendering method, the natural language including a plurality of international languages, the natural language data rendering method including:
s101, constructing a structured character string of natural language, wherein the structured character string comprises nodes, variables and preset fixed character strings; the nodes are used for identifying variables and fixed character strings; the preset fixed character strings correspond to the fixed expression of the natural language; the fixed expression of natural language includes words, phrases, and punctuation marks of natural language. The preset fixed character string comprises a separation symbol and a connective.
Specifically, the nodes include phrase nodes, separator nodes, connector nodes, singular nodes and plural nodes; the phrase node is used for identifying a character string comprising variables; the separation node is used for identifying separation symbol character strings of natural language; the connection node is used for marking a connection word character string of the natural language; the singular node is used for identifying fixed character strings corresponding to singular nouns of the natural language data; the plurality of nodes are used for identifying fixed character strings corresponding to a plurality of nouns of the natural language data.
For example, a structured string is constructed as follows:
[phrase]
<a href="https://${{locale}}.trip.com/hotels/${{cityname}}-hotel-detail-${{hotelid}}/${{hotelnameurl}}/">${{hotelname}}</a>
[phrase]
[separator],[separator]
[ connections ] and [ connections ]
The [ regular ] is the most popular hotel. [ regular ]
All are the most popular hotels. [ plural ]
The phrase node [ phrase ] is used to identify the string < a href= "https:// $ { locale }, triple. Com/hotels/$ { cityname } }, hotel-deltail- $ { hotelid }/$ { hotelname }/" $ { hotelname }, j }, and }, including the variable. The string contains all the attributes of the variable, locale, cityname, hotelid, hotelnameurl, hotelname.
The separator node is used for identifying a character string of separator symbols of natural language, and in Chinese, the separator symbols can be ", and the like.
The connective nodes are used to identify the connective word strings of natural language, and in Chinese, the connective words may be "sum", "and", etc.
The singular node is used for identifying fixed character strings corresponding to singular nouns of natural language data; the plural nodes [ plurals ] are used for identifying fixed character strings corresponding to plural nouns of the natural language data. In Chinese, the plural expressions will generally include terms of "all", and the like.
The phrase nodes, separator nodes, connector nodes, singular nodes and plural nodes are arranged according to the natural language. In the prior art, a great deal of manpower is required to be expended on adjusting each character sequence in the character string to correspond to the word sequence of the natural language, but the structured character string in the embodiment marks verbs, nouns, adjectives, conjunctions and the like of the natural language through nodes according to actual needs, and the structured character string is arranged according to the sequence conforming to the word sequence of the natural language, so that a great deal of time and workload are saved.
The embodiment only enumerates a node classification and setting method, but the node classification and setting method and the construction method of the structured character string have universality, and according to natural language sequences of natural languages (Chinese, english) and the like, and the inherent logic of verbs, nouns, adjectives and conjunctions, the node identification is utilized and the arrangement sequence is adjusted, so that the language diversity can be met by properly adjusting on the basis of the scheme of the embodiment.
S102, judging whether natural language data corresponding to the variables exist or not, if so, acquiring the natural language data, replacing the variables with the natural language data, and if not, stopping replacing the variables;
the data of the variables of the structured string are, for example, as described above:
locale:en_us
cityname:shanghai
hotel:[{hotelid:1,hotelurl:peace-hotel,name:peace-hotel},
{hotelid:2,hotelurl:citigo-hotel,name:citigo-hotel},
{hotelid:3,hotelurl:Grand-Hyatt-Shanghai,name:citigo-hotel}]
s103, traversing the natural language data, judging whether the natural language data need separating symbols and/or connecting words, if so, adding separating symbol character strings and/or connecting word character strings of node identifiers between the natural language data, and rendering, otherwise, directly rendering the natural language data;
specifically, the step of determining whether the natural language data requires separation of symbols or connective words includes:
counting the number of natural language data;
if the number of the natural language data is 1, judging that the natural language data does not need separation symbols or connective words;
if the number of the natural language data is 2, judging that the natural language data needs a connecting word and does not need a separation symbol;
if the number of the natural language data is greater than or equal to 3, judging that the natural language data needs a connecting word and at least one separation symbol.
Specifically, a loop node [ loop ] may be set. Loop nodes are used to identify the beginning of traversal through natural language data. If the number of the natural language data is greater than or equal to 3, judging that the natural language data needs a connecting word and at least one separation symbol, wherein the connecting word is positioned between the last two natural language data in Chinese.
S104, selecting fixed character strings corresponding to the number of the node identifiers according to the number of the natural language data to render so as to obtain target character strings running on the user interface.
Specifically, a selection node [ switch ] may be set. The selection node switch is used for identifying fixed character strings corresponding to the quantity of the natural language data to be selected. The above structured string becomes after adding loop node [ loop ] and select node [ switch ]:
[loop]
[phrase]
<a href="https://${{locale}}.trip.com/hotels/${{cityname}}-hotel-detail-${{hotelid}}/${{hotelnameurl}}/">${{hotelname}}</a>
[phrase]
[separator],[separator]
[ connections ] and [ connections ]
[switch]
The [ regular ] is the most popular hotel. [ regular ]
All are the most popular hotels. [ plural ]
[switch]
The target character string obtained after rendering is
< a href = "https:// en_us. Trip. Com/hotels/Shanghai-detail-hotel-1/pepe-hotel/" > pepe-hotel >, < a href = "https:// en_us. Trip. Com/hotels/Shanghai-detail-hotel-2/citigo-hotel/" > citigo-hotel </i >, and < ahref = "https:// en_us. Trip. Com/hotels/Shanghai-detail-hotel-3/Grand-Hyatt-Shangaai/" > Grand-Hyatt-Shangaai are all the most aerated hotels.
The following is a structured string of english constructed by using the natural language rendering method of the present embodiment:
Many travelers pass through${{trainstationname}}in${{cityname}}each day.For this reason,travelers often stay at nearby accommodations.
[loop#hotels]
[phrase]<a href="https://${{locale}}.trip.com/hotels/${{cityurl}}-hotel-detail-${{hotelid}}/${{hotelurl}}/">${{hotelname}}</a>[phrase]
[separator],[separator]
[conjunctions]and[conjunctions]
[loop]
[switch#select]
[singular]is a popular hotel near${{trainstationname}}.If you choose to stay here,make sure to book in advance.[singular]
[plural]are all popular hotels near${{trainstationname}}.If you choose to stay at one of these hotels,make sure to book in advance.[plural]
[switch]
according to the embodiment, the natural language character string is structured by utilizing the node to mark the variable and the fixed character string of the natural language, the word, the phrase and the punctuation mark which are used fixedly are marked by different nodes, the proper fixed character string is called by the nodes according to the quantity of the natural language data, and meanwhile, the arrangement sequence of the different types of nodes is adjusted according to the language sequence of the natural language, so that when the data of the variable are lost, the variable can be normally rendered, ambiguity is not caused, the consistency of the semantic meaning and the normal natural language sequence are ensured, and the browsing experience of a user is improved.
Example 2
As shown in fig. 2, the present embodiment provides an optimization method for the SEO ranking of an OTA website, which includes:
s201, acquiring data corresponding to variables of an OTA website;
s202, obtaining a target character string corresponding to the natural language of the OTA website by using the natural language data rendering method in the embodiment 1;
s203, the front end of the OTA website executes the target character string.
According to the embodiment, the background natural language data is rendered at the front end of the website by using the natural language data rendering method, so that the data of the variables can be normally rendered when lost, ambiguity cannot be caused, consistency of semantics and normal natural language sequence are ensured, browsing experience of a user is improved, and SEO ranking of the website is improved.
Example 3
As shown in fig. 3, the present embodiment provides a natural language data rendering system, the natural language including a plurality of international languages, the natural language data rendering system including:
the system comprises a structured character string construction module 11, wherein the structured character string construction module 11 is used for constructing a structured character string of natural language, and the structured character string comprises nodes, variables and preset fixed character strings; the nodes are used for identifying variables and fixed character strings; the preset fixed character strings correspond to the fixed expression of the natural language; the fixed expression of natural language includes words, phrases, and punctuation marks of natural language. The preset fixed character string comprises a separation symbol and a connective;
specifically, the nodes include phrase nodes, separator nodes, connector nodes, singular nodes and plural nodes; the phrase node is used for identifying a character string comprising variables; the separation node is used for identifying separation symbol character strings of natural language; the connection node is used for marking a connection word character string of the natural language; the singular node is used for identifying fixed character strings corresponding to singular nouns of the natural language data; the plurality of nodes are used for identifying fixed character strings corresponding to a plurality of nouns of the natural language data.
For example, a structured string is constructed as follows:
[phrase]
<a href="https://${{locale}}.trip.com/hotels/${{cityname}}-hotel-detail-${{hotelid}}/${{hotelnameurl}}/">${{hotelname}}</a>
[phrase]
[separator],[separator]
[ connections ] and [ connections ]
The [ regular ] is the most popular hotel. [ regular ]
All are the most popular hotels. [ plural ]
The phrase node [ phrase ] is used to identify the string < a href= "https:// $ { locale }, triple. Com/hotels/$ { cityname } }, hotel-deltail- $ { hotelid }/$ { hotelname }/" $ { hotelname }, j }, and }, including the variable. The string contains all the attributes of the variable, locale, cityname, hotelid, hotelnameurl, hotelname.
The separator node is used for identifying a character string of separator symbols of natural language, and in Chinese, the separator symbols can be ", and the like.
The connective nodes are used to identify the connective word strings of natural language, and in Chinese, the connective words may be "sum", "and", etc.
The singular node is used for identifying fixed character strings corresponding to singular nouns of natural language data; the plural nodes [ plurals ] are used for identifying fixed character strings corresponding to plural nouns of the natural language data. In Chinese, the plural expressions will generally include terms of "all", and the like.
The phrase nodes, separator nodes, connector nodes, singular nodes and plural nodes are arranged according to the natural language. In the prior art, a great deal of manpower is required to be expended on adjusting each character sequence in the character string to correspond to the word sequence of the natural language, but the structured character string in the embodiment marks verbs, nouns, adjectives, conjunctions and the like of the natural language through nodes according to actual needs, and the structured character string is arranged according to the sequence conforming to the word sequence of the natural language, so that a great deal of time and workload are saved.
The embodiment only enumerates a node classification and setting method, but the node classification and setting method and the construction method of the structured character string have universality, and according to natural language sequences of natural languages (Chinese, english) and the like, and the inherent logic of verbs, nouns, adjectives and conjunctions, the node identification is utilized and the arrangement sequence is adjusted, so that the language diversity can be met by properly adjusting on the basis of the scheme of the embodiment.
The data acquisition module 12 is configured to determine whether natural language data corresponding to the variable exists, if yes, acquire the natural language data, replace the variable with the natural language data, and if no, stop replacing the variable with the data;
the data of the variables of the structured string are, for example, as described above:
locale:en_us
cityname:shanghai
hotel:[{hotelid:1,hotelurl:peace-hotel,name:peace-hotel},
{hotelid:2,hotelurl:citigo-hotel,name:citigo-hotel},
{hotelid:3,hotelurl:Grand-Hyatt-Shanghai,name:citigo-hotel}]
the data processing module 13 is used for traversing the natural language data, judging whether the natural language data needs separation symbols and/or connection words, if yes, adding separation symbol character strings and/or connection word character strings of node identifiers between the natural language data, and rendering, otherwise, directly rendering the natural language data;
specifically, the data processing module 13 is further configured to count the number of natural language data;
if the number of the natural language data is 1, judging that the natural language data does not need separation symbols or connective words;
if the number of the natural language data is 2, judging that the natural language data needs connecting words and does not need separating symbols;
if the number of the natural language data is greater than or equal to 3, judging that the natural language data needs a connective and at least one separation symbol.
Specifically, a loop node [ loop ] may be set. Loop nodes are used to identify the beginning of traversal through natural language data. If the number of the natural language data is greater than or equal to 3, judging that the natural language data needs a connecting word and at least one separation symbol, wherein the connecting word is positioned between the last two natural language data in Chinese.
The fixed character string processing module 14, the fixed character string processing module 14 is configured to select, according to the number of the natural language data, a fixed character string corresponding to the number of the node identifiers or a fixed character string corresponding to a plurality of nouns for rendering, so as to obtain a target character string running on the user interface.
Specifically, a selection node [ switch ] may be set. The selection node switch is used for identifying fixed character strings corresponding to the quantity of the natural language data to be selected. The above structured string becomes after adding loop node [ loop ] and select node [ switch ]:
[loop]
[phrase]
<a href="https://${{locale}}.trip.com/hotels/${{cityname}}-hotel-detail-${{hotelid}}/${{hotelnameurl}}/">${{hotelname}}</a>
[phrase]
[separator],[separator]
[ connections ] and [ connections ]
[switch]
The [ regular ] is the most popular hotel. [ regular ]
All are the most popular hotels. [ plural ]
[switch]
The target character string obtained after rendering is
< a href = "https:// en_us. Trip. Com/hotels/Shanghai-detail-hotel-1/pepe-hotel/" > pepe-hotel >, < a href = "https:// en_us. Trip. Com/hotels/Shanghai-detail-hotel-2/citigo-hotel/" > citigo-hotel </i >, and < ahref = "https:// en_us. Trip. Com/hotels/Shanghai-detail-hotel-3/Grand-Hyatt-Shangaai/" > Grand-Hyatt-Shangaai are all the most aerated hotels.
The following is a structured string of english constructed using the natural language rendering system of the present embodiment:
Many travelers pass through${{trainstationname}}in${{cityname}}each day.For this reason,travelers often stay at nearby accommodations.
[loop#hotels]
[phrase]<a href="https://${{locale}}.trip.com/hotels/${{cityurl}}-hotel-detail-${{hotelid}}/${{hotelurl}}/">${{hotelname}}</a>[phrase]
[separator],[separator]
[conjunctions]and[conjunctions]
[loop]
[switch#select]
[singular]is a popular hotel near${{trainstationname}}.If you choose to stay here,make sure to book in advance.[singular]
[plural]are all popular hotels near${{trainstationname}}.If you choose to stay at one of these hotels,make sure to book in advance.[plural]
[switch]
according to the embodiment, the natural language character string is structured by utilizing the node to mark the variable and the fixed character string of the natural language, the word, the phrase and the punctuation mark which are used fixedly are marked by different nodes, the proper fixed character string is called by the nodes according to the quantity of the natural language data, and meanwhile, the arrangement sequence of the different types of nodes is adjusted according to the language sequence of the natural language, so that when the data of the variable are lost, the variable can be normally rendered, ambiguity is not caused, the consistency of the semantic meaning and the normal natural language sequence are ensured, and the browsing experience of a user is improved.
Example 4
As shown in fig. 4, the present embodiment provides an OTA website SEO ranking optimization system, which includes:
the website data acquisition module 21, the website data acquisition module 21 is used for acquiring data corresponding to the variable of the OTA website;
the data rendering module 22, where the data rendering module 22 is configured to obtain a target string corresponding to a natural language of the OTA website by using the natural language data rendering system of embodiment 3;
the character string executing module 23, the character string executing module 23 is configured to execute the target character string.
According to the embodiment, the background natural language data is rendered at the front end of the website by using the natural language data rendering method, so that the data of the variable can be normally rendered when lost, ambiguity cannot be caused, consistency of semantics and normal natural language sequence are ensured, browsing experience of a user is improved, and SEO ranking of an OTA website is improved.
Example 5
Fig. 5 is a schematic structural diagram of an electronic device according to embodiment 5 of the present invention. The electronic device includes a memory, a processor, and a computer program stored on the memory and executable on the processor, which when executed implements the natural language data rendering method of embodiment 1 or the OTA website SEO ranking optimization method of embodiment 2. The electronic device 30 shown in fig. 5 is merely an example and should not be construed as limiting the functionality and scope of use of embodiments of the present invention.
As shown in fig. 5, the electronic device 30 may be embodied in the form of a general purpose computing device, which may be a server device, for example. Components of electronic device 30 may include, but are not limited to: the at least one processor 31, the at least one memory 32, a bus 33 connecting the different system components, including the memory 32 and the processor 31.
The bus 33 includes a data bus, an address bus, and a control bus.
Memory 32 may include volatile memory such as Random Access Memory (RAM) 321 and/or cache memory 322, and may further include Read Only Memory (ROM) 323.
Memory 32 may also include a program/utility 325 having a set (at least one) of program modules 324, such program modules 324 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment.
The processor 31 executes various functional applications and data processing such as the natural language data rendering method of embodiment 1 of the present invention or the OTA website SEO ranking optimization method of embodiment 2 by running a computer program stored in the memory 32.
The electronic device 30 may also communicate with one or more external devices 34 (e.g., keyboard, pointing device, etc.). Such communication may be through an input/output (I/O) interface 35. Also, model-generating device 30 may also communicate with one or more networks, such as a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet, via network adapter 36. As shown, network adapter 36 communicates with the other modules of model-generating device 30 via bus 33. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in connection with the model-generating device 30, including, but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (disk array) systems, tape drives, data backup storage systems, and the like.
It should be noted that although several units/modules or sub-units/modules of an electronic device are mentioned in the above detailed description, such a division is merely exemplary and not mandatory. Indeed, the features and functionality of two or more units/modules described above may be embodied in one unit/module in accordance with embodiments of the present invention. Conversely, the features and functions of one unit/module described above may be further divided into ones that are embodied by a plurality of units/modules.
Example 6
The present embodiment provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the natural language data rendering method of embodiment 1 or the OTA website SEO ranking optimization method of embodiment 2.
More specifically, among others, readable storage media may be employed including, but not limited to: portable disk, hard disk, random access memory, read only memory, erasable programmable read only memory, optical storage device, magnetic storage device, or any suitable combination of the foregoing.
In a possible implementation manner, the present invention may also be implemented in the form of a program product including program code for causing a terminal device to perform the steps of implementing the natural language data rendering method of embodiment 1 or the OTA website SEO ranking optimization method of embodiment 2 when the program product is run on the terminal device.
Wherein the program code for carrying out the invention may be written in any combination of one or more programming languages, which program code may execute entirely on the user device, partly on the user device, as a stand-alone software package, partly on the user device and partly on the remote device or entirely on the remote device.
While specific embodiments of the invention have been described above, it will be appreciated by those skilled in the art that this is by way of example only, and the scope of the invention is defined by the appended claims. Various changes and modifications to these embodiments may be made by those skilled in the art without departing from the principles and spirit of the invention, but such changes and modifications fall within the scope of the invention.

Claims (10)

1. A natural language data rendering method, characterized in that the natural language data rendering method comprises:
constructing a structured character string of natural language, wherein the structured character string comprises nodes, variables and preset fixed character strings;
the node is used for identifying the variable and the fixed character string;
the nodes comprise phrase nodes, separation nodes, connection nodes, singular nodes and plural nodes, wherein the phrase nodes, the separation nodes, the connection nodes, the singular nodes and the plural nodes are arranged according to the word order of the natural language;
the preset fixed character string corresponds to the fixed expression of the natural language, and the fixed expression of the natural language comprises words, phrases and punctuations of the natural language;
the preset fixed character string comprises a separation symbol and a connective;
the structured character string marks and adjusts the arrangement sequence of verbs, nouns, adjectives and conjunctions of the natural language through the nodes;
judging whether natural language data corresponding to the variable exist or not, if so, acquiring the natural language data, replacing the variable with the natural language data, and if not, stopping data replacement of the variable;
traversing the natural language data, judging whether the natural language data needs separation symbols and/or connective words, if yes, adding separation symbol character strings and/or connective word character strings of the node identifiers between the natural language data, and rendering, otherwise, directly rendering the natural language data;
selecting fixed character strings corresponding to the number of the node identifiers according to the number of the natural language data to render so as to obtain target character strings running on a user interface;
the step of selecting the fixed character strings corresponding to the number of the node identifiers according to the number of the natural language data to render so as to obtain the target character strings running on the user interface comprises the following steps:
identifying the words, the phrases and the punctuations which are fixedly used through different nodes;
calling the corresponding fixed character strings through the nodes according to the quantity of the natural language data;
and adjusting the arrangement sequence of the nodes of different types according to the language order of the natural language so as to obtain the target character string.
2. The natural language data rendering method of claim 1, wherein the phrase node is used to identify a character string including the variable;
the separation node is used for identifying a separation symbol character string of the natural language;
the connection node is used for identifying a connection word character string of the natural language;
the singular node is used for identifying fixed character strings corresponding to singular nouns of the natural language data;
the plurality of nodes are used for identifying fixed character strings corresponding to a plurality of nouns of the natural language data;
and/or the number of the groups of groups,
the natural language includes a plurality of international languages.
3. The method of claim 1, wherein the step of determining whether the natural language data requires a separator symbol or a connective comprises:
counting the number of the natural language data;
if the number of the natural language data is 1, judging that the natural language data does not need separation symbols or connective words;
if the number of the natural language data is 2, judging that the natural language data needs a connecting word and does not need a separation symbol;
if the number of the natural language data is greater than or equal to 3, judging that the natural language data needs a connective and at least one separation symbol.
4. The OTA website SEO ranking optimization method is characterized by comprising the following steps of:
acquiring data corresponding to the variable of the OTA website;
obtaining a target character string corresponding to the natural language of the OTA website by using the natural language data rendering method according to any one of claims 1-3;
and the front end of the OTA website executes the target character string.
5. A natural language data rendering system, the natural language data rendering system comprising:
the system comprises a structured character string construction module, a storage module and a storage module, wherein the structured character string construction module is used for constructing a structured character string of natural language, and the structured character string comprises nodes, variables and preset fixed character strings;
the node is used for identifying the variable and the fixed character string;
the nodes comprise phrase nodes, separation nodes, connection nodes, singular nodes and plural nodes, wherein the phrase nodes, the separation nodes, the connection nodes, the singular nodes and the plural nodes are arranged according to the word order of the natural language;
the preset fixed character string corresponds to the fixed expression of the natural language, and the fixed expression of the natural language comprises words, phrases and punctuations of the natural language;
the preset fixed character string comprises a separation symbol and a connective;
the structured character string marks and adjusts the arrangement sequence of verbs, nouns, adjectives and conjunctions of the natural language through the nodes;
the data acquisition module is used for judging whether natural language data corresponding to the variable exist or not, if yes, acquiring the natural language data, replacing the variable with the natural language data, and if not, stopping data replacement for the variable;
the data processing module is used for traversing the natural language data, judging whether the natural language data need separating symbols and/or connecting words, if yes, adding separating symbol character strings and/or connecting word character strings of the node identifiers between the natural language data, and rendering, otherwise, directly rendering the natural language data;
the fixed character string processing module is used for selecting fixed character strings corresponding to the number of the node identifiers according to the number of the natural language data to render so as to obtain target character strings running on a user interface;
the fixed character string processing module is further used for identifying the words, the phrases and the punctuations which are used fixedly through different nodes;
calling the corresponding fixed character strings through the nodes according to the quantity of the natural language data;
and adjusting the arrangement sequence of the nodes of different types according to the language order of the natural language so as to obtain the target character string.
6. A natural language data rendering system of claim 5, wherein the phrase node is to identify a string comprising the variable;
the separation node is used for identifying a separation symbol character string of the natural language;
the connection node is used for identifying a connection word character string of the natural language;
the singular node is used for identifying fixed character strings corresponding to singular nouns of the natural language data;
the plurality of nodes are used for identifying fixed character strings corresponding to a plurality of nouns of the natural language data;
and/or the number of the groups of groups,
the natural language includes a plurality of international languages.
7. The natural language data rendering system of claim 5, wherein the data processing module is further configured to count the amount of natural language data;
if the number of the natural language data is 1, judging that the natural language data does not need separation symbols or connective words;
if the number of the natural language data is 2, judging that the natural language data needs a connecting word and does not need a separation symbol;
and if the number of the natural language data is greater than or equal to 3, judging that the natural language data needs a connective and at least one separation symbol.
8. An OTA website SEO ranking optimization system, the OTA website SEO ranking optimization system comprising:
the website data acquisition module is used for acquiring data corresponding to the variable of the OTA website;
a data rendering module, configured to obtain a target string corresponding to a natural language of the OTA website by using the natural language data rendering system according to any one of claims 5 to 7;
and the character string execution module is used for executing the target character string.
9. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the natural language data rendering method of any one of claims 1-3 or the OTA website SEO ranking optimization method of claim 4 when the computer program is executed by the processor.
10. A computer readable storage medium having stored thereon a computer program, which when executed by a processor implements the natural language data rendering method of any one of claims 1-3 or the OTA website SEO ranking optimization method of claim 4.
CN202110259839.7A 2021-03-10 2021-03-10 Natural language data rendering and website optimizing method, system, equipment and medium Active CN113032700B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110259839.7A CN113032700B (en) 2021-03-10 2021-03-10 Natural language data rendering and website optimizing method, system, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110259839.7A CN113032700B (en) 2021-03-10 2021-03-10 Natural language data rendering and website optimizing method, system, equipment and medium

Publications (2)

Publication Number Publication Date
CN113032700A CN113032700A (en) 2021-06-25
CN113032700B true CN113032700B (en) 2023-11-10

Family

ID=76469068

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110259839.7A Active CN113032700B (en) 2021-03-10 2021-03-10 Natural language data rendering and website optimizing method, system, equipment and medium

Country Status (1)

Country Link
CN (1) CN113032700B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109241264A (en) * 2012-12-31 2019-01-18 脸谱公司 The natural language rendering of structured search inquiry

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109241264A (en) * 2012-12-31 2019-01-18 脸谱公司 The natural language rendering of structured search inquiry

Also Published As

Publication number Publication date
CN113032700A (en) 2021-06-25

Similar Documents

Publication Publication Date Title
CN101361065B (en) Encoding and adaptive, scalable accessing of distributed models
CN113110988B (en) Testing applications with defined input formats
JP6922538B2 (en) API learning
US6904402B1 (en) System and iterative method for lexicon, segmentation and language model joint optimization
EP3748548A1 (en) Adversarial learning-based text annotation method and device
US10558756B2 (en) Unsupervised information extraction dictionary creation
US20120158742A1 (en) Managing documents using weighted prevalence data for statements
CN108563629B (en) Automatic log analysis rule generation method and device
WO2022116435A1 (en) Title generation method and apparatus, electronic device and storage medium
CN110851136A (en) Data acquisition method and device, electronic equipment and storage medium
US20180121444A1 (en) Unsupervised information extraction dictionary creation
US10885281B2 (en) Natural language document summarization using hyperbolic embeddings
WO2022134577A1 (en) Translation error identification method and apparatus, and computer device and readable storage medium
JP2022054389A (en) Method and apparatus for training retrieval model, device, computer storage medium, and computer program
CN111783401B (en) Character string processing method and device, computer storage medium and electronic equipment
CN113032700B (en) Natural language data rendering and website optimizing method, system, equipment and medium
CN113704420A (en) Method and device for identifying role in text, electronic equipment and storage medium
CN111796833A (en) Code language conversion method, system, equipment and storage medium
US20210011693A1 (en) Back-end application code stub generation from a front-end application wireframe
CN113868447A (en) Picture retrieval method, electronic device and computer-readable storage medium
US20150324333A1 (en) Systems and methods for automatically generating hyperlinks
CN115525730B (en) Webpage content extraction method and device based on page weighting and electronic equipment
US11720531B2 (en) Automatic creation of database objects
US20220350829A1 (en) Method and apparatus for processing data based on knowledge graph, electronic device and medium
US20230053344A1 (en) Scenario generation apparatus, scenario generation method, and computer-readablerecording medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant