CN115510362A - System for automatically generating web front-end codes according to natural language description documents - Google Patents

System for automatically generating web front-end codes according to natural language description documents Download PDF

Info

Publication number
CN115510362A
CN115510362A CN202211285562.6A CN202211285562A CN115510362A CN 115510362 A CN115510362 A CN 115510362A CN 202211285562 A CN202211285562 A CN 202211285562A CN 115510362 A CN115510362 A CN 115510362A
Authority
CN
China
Prior art keywords
unit
sub
logic
keyword
natural language
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.)
Pending
Application number
CN202211285562.6A
Other languages
Chinese (zh)
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.)
Shanghai Baoyun Network Information Service Co ltd
Original Assignee
Shanghai Baoyun Network Information Service 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 Shanghai Baoyun Network Information Service Co ltd filed Critical Shanghai Baoyun Network Information Service Co ltd
Priority to CN202211285562.6A priority Critical patent/CN115510362A/en
Publication of CN115510362A publication Critical patent/CN115510362A/en
Pending legal-status Critical Current

Links

Images

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/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • 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
    • G06F16/9577Optimising the visualization of content, e.g. distillation of HTML documents

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Machine Translation (AREA)

Abstract

The invention relates to a system for automatically generating a Web front-end code according to a natural language description document, which relates to the field of automatic generation of computer codes and comprises a data input unit, a structured logic generation unit, a sub-logic generation unit, a component type calculation unit, a structured component tree generation unit and a Web page rendering unit.

Description

System for automatically generating web front-end codes according to natural language description documents
Technical Field
The invention relates to the field of automatic generation of computer codes, in particular to a system and a method for generating web front-end codes according to natural language of natural language description documents.
Background
The Web front-end development mainly utilizes various Web technologies such as HTML/CSS/JavaScript/Flash to develop a client product, completes the development of a client program (namely a browser end), develops a JavaScript and Flash module, simultaneously simulates the whole effect by combining a background development technology to develop Web rich in the Internet, and aims to improve the user experience through the technology.
For a Web front-end development programmer, the existing development mode is that a line of handwriting codes realize specific requirements, and finally a display page is formed for a terminal user, and the process needs cooperation of a demand party, a product manager and the Web front-end development programmer in three parties to complete the on-line of a page function. The demand side puts forward demands to the product manager according to business needs, the product manager writes demand documents according to the demands, and Web front-end developers achieve Web page effects according to the demand documents. As shown in fig. 1, this development method requires multi-party cooperation, and has the problems of long development link, low efficiency, high error rate, and the like.
In the prior art, in order to improve the front-end page development efficiency, some systems capable of generating corresponding codes by dragging are generally available, for example, chinese patent ZL201410320408.7 relates to a Web-based service system page development platform and method, and a JS technology is used to drag and generate a technical component and a service component through a Web-based development environment, and the technical component and the service component are called to generate a service processing static page. The development process of dragging and generating the code is shown in fig. 2, the efficiency is improved to a certain extent by the scheme, but the whole development process is still the traditional mode, only a low code generation system with a draggable component is added in the middle, the development link is still long, and the problems of low efficiency and high error rate due to the fact that multi-party cooperation is needed still exist.
Disclosure of Invention
The present invention is directed to overcoming the above-mentioned deficiencies of the prior art and providing a method for generating Web front-end code from manual development to automatic generation. The method utilizes natural language recognition and analysis technology, automatically generates data required by the Web front-end page in a mode of carrying out data modeling on an insurance product description document, and finally automatically generates the Web front-end page by using a component rendering engine. In the process, a product manager and a Web front-end developer both play an auxiliary role, so that the development link is shortened, and the development efficiency is greatly improved. The technical scheme of the invention is as follows:
a system for automatically generating a Web front-end code from a natural language specification document, comprising a data input unit, a structured logic generating unit, a sub-logic generating unit, a component type calculating unit, a structured component tree generating unit, and a Web page rendering unit, wherein:
a data input unit for inputting a natural language specification document into a computer;
the structured logic generation unit comprises a natural language preprocessing module, and is used for splitting the natural language description document into logic units of natural language and marking the logic units;
the sub-logic generation unit comprises a keyword analysis module and a keyword rule set; the keyword analysis module carries out data splitting on the logic unit by utilizing a word segmentation algorithm to form a keyword set; the keyword rule set comprises preset keyword processing rules, display modes and interaction modes of keywords; matching the keyword set according to a preset keyword processing rule, and extracting display data according to the matched keywords to form a sub-logic unit, wherein the sub-logic unit comprises three dimensions of display data, a display mode and an interaction mode;
the component type calculation unit comprises a sub logic unit analysis module and an atomization component library set; the atomization component library comprises description information of the characteristics of various components; the sub-logic unit analysis module matches the sub-logic unit with the description information, and determines the component type of the sub-logic unit after the matching is successful;
the structured component tree generating unit is used for nesting the sub logic units matched with the component types and the logic units into a tree structure to form a structured component tree;
and the Web page rendering unit is used for receiving the structured component tree and rendering the Web front-end page.
Furthermore, the natural language preprocessing module splits the document according to one or more of paragraphs, major titles, minor titles, chinese character number titles, arabic number titles, periods, commas and semicolons of the natural language description document.
Furthermore, the sub-logic generation unit performs similarity matching on the keyword set according to a preset keyword processing rule, and the similarity of successful matching is a dynamic value or a fixed value.
Further, in the sub-logic generating unit, a logic unit corresponding to a keyword set which is not successfully matched with the preset keyword processing rule is defined as a logic unit to be analyzed, the logic unit to be analyzed defines keywords in a manual analysis mode, and the keywords are placed in the keyword rule set and are matched again.
Further, the preset keyword processing rule comprises a keyword white list and a keyword blacklist, and when the keyword set is matched with the keyword white list, a sub-logic unit is generated; generating only additional information when the set of keywords matches the keyword blacklist.
Furthermore, the sub logic unit also comprises an associated logic unit, wherein a secondary associated vocabulary and a tertiary associated vocabulary are preset in the associated logic unit according to the display data in the sub logic unit, and the sub logic unit analysis module determines the corresponding component type according to the secondary associated vocabulary and the tertiary associated vocabulary.
An application of a system for automatically generating Web front-end codes according to natural language description documents in insurance product Web development.
The technical scheme of the invention has the following advantages:
according to the method and the device, data required by the web front-end page are automatically generated by utilizing a natural language recognition and analysis technology and combining a specific product data modeling mode, and finally the web front-end page is automatically generated by using a component rendering engine. In the process, a product manager and a web front-end developer both play an auxiliary role, a development link is shortened, the development efficiency is greatly improved, and particularly the work efficiency can be greatly improved aiming at the web front-end code development of an insurance product.
Drawings
The above and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
FIG. 1 is a flow chart of a common Web-side manual development;
FIG. 2 is a flow diagram of a drag-and-drop auxiliary Web-side development;
FIG. 3 is a schematic diagram of a system for automatically generating web front end code from a natural language specification document according to the present application;
FIG. 4 is a flow chart of the operation of the sub-logic generation unit;
FIG. 5 is an example of an application for Web development of insurance products.
Detailed Description
The technical solutions of the present invention will be described clearly and completely with reference to the accompanying drawings, and it is to be understood that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to the protection scope of the present invention.
As shown in FIG. 3, the present invention provides a system for automatically generating Web front-end code from a natural language specification document, which includes a data input unit 100, a structured logic generation unit 200, a sub-logic generation unit 300, a component type calculation unit 400, a structured component tree generation unit 500, and a Web page rendering unit 600.
The data input unit 100 is used to input a natural language specification document into a computer. The structural logic generation unit 200 includes a natural language preprocessing module 210, which splits the natural language specification document into logic units 220 of natural language and marks them.
The sub-logic generating unit 300 includes a keyword analyzing module 310 and a keyword rule set 320, the keyword analyzing module 310 performs data splitting on the logic unit 220 by using a word segmentation algorithm to form a keyword set 340, and the keyword rule set 320 includes preset keyword processing rules 330 and a display mode and an interaction mode of keywords; matching the keyword set 340 according to a preset keyword processing rule 330, and extracting display data according to the matched keywords to form a sub-logic unit 350, wherein the sub-logic unit 350 comprises three dimensions of display data, a display mode and an interaction mode.
The component type calculation unit 400 includes a sub-logic unit analysis module 410 and an atomized component library set 420, the atomized component library set 420 includes description information of features of various components, and the sub-logic unit analysis module 410 matches the sub-logic unit 350 with the description information and then determines the component type of the sub-logic unit 350. The structural component tree generating unit 500 nests the sub logic unit 350 and the logic unit 220 matched with the component type into a tree structure to form a structural component tree. The Web page rendering unit 600 is configured to receive the structured component tree and render a Web front-end page, where the Web page rendering unit 600 includes.
According to different splitting granularity requirements, the natural language preprocessing module 210 may split the natural language description document according to the contents of paragraphs, titles, punctuation marks, or the like. For example, when the granularity required to be split is coarse, and the part of the same logic description is prevented from being split into different logic units, the splitting can be performed according to paragraphs or titles, wherein the titles can be major titles, minor titles, chinese character digital titles or Arabic digital titles; when the granularity required to be split is fine and the parts of different logic descriptions are prevented from being split into the same logic unit, splitting can be performed according to punctuations such as periods, semicolons, commas, pause signs and the like; in the face of complex requirements, paragraphs, titles or punctuation marks can be mixed for splitting.
The segmentation algorithm in the keyword analysis module 310 is preferably split into several keyword sets 340 by using the ending segmentation (open source chinese NLP library algorithm).
The preset keyword processing rule 330 matches the keyword set 340, the matching degree is not necessarily 100%, and the matching degree may be set to a fixed value, for example, 90% or 85%, according to the requirement, or may be set to a dynamic value according to different contexts, so as to improve the matching accuracy and applicability.
As shown in fig. 4, which is a working flow of the sub-logic generating unit 300, the keyword processing rule 330 includes a keyword white list 331 and a keyword black list 332, and when the keyword set 340 matches with the keyword white list 331, the sub-logic generating unit 350 is normally formed; generating only additional information 360 when the set of keywords 340 matches the keyword blacklist 332; when the keyword set 340 is not successfully matched with the keyword white list 331 or the keyword black list 332, defining the logic unit corresponding to the keyword set as the logic unit to be analyzed 370, determining a new keyword in a manual analysis manner, and placing the new keyword into the keyword white list 331 or the keyword black list 332 for re-matching.
The atomized component library set 420 of the component type calculation unit 400 includes description information of features of various components, and the sub-logic unit analysis module 410 analyzes and matches the presentation data, the presentation mode, and the interaction mode in the sub-logic unit 350 with the description information to determine the component type of the sub-logic unit 350. For example, the characteristic description information of a component includes the presentation data, the presentation mode, and the interaction mode included in the component, and when the corresponding information of the sub-logical unit 350 matches the description information of the component, the type of the sub-logical unit 350 is defined.
As can be seen from the above workflow, the logic unit 220 and the sub-logic unit 350 are in a tree structure with a nested relationship, and the structured component tree generating unit 500 is to construct the logic unit 220 and the sub-logic unit 350 into a tree structure, that is, a structured component tree, where the structured component tree includes basic information of types, interactions, data, and the like of various components.
The Web page rendering unit 600 is built in the atomization component library set 420, and can calculate the specific components to be rendered in the structured component tree through type matching, and then perform rendering of the front-end Web page according to the information of the component types, interactions, data, and the like.
As a preferred scheme, the sub-logic unit 350 further includes an associated logic unit 380, the associated logic unit 380 presets a secondary associated vocabulary and a tertiary associated vocabulary according to the presentation data of the sub-logic unit 350, and the sub-logic unit analysis module 410 determines the component type corresponding to the secondary associated vocabulary and the tertiary associated vocabulary. That is to say, the management logical unit 380 in the partial sub logical unit 350 may be correspondingly provided with a corresponding associated vocabulary according to the presentation data, and the associated vocabulary also corresponds to a component type, and the component type is determined by the analysis module 410 of the sub logical unit.
As shown in fig. 5, in order to generate a page by taking an example of an application of the system for automatically generating a Web front-end code according to a natural language description document in the Web development of insurance products, a workflow is specifically described below with respect to the example.
The natural language description document is an insurance product description, and the specific contents are as follows:
if you had the following symptoms, they were informed of the following illness or receiving treatment, if please specify; respiratory diseases: such as recurrent cough, hemoptysis, asthma, dyspnea, chronic bronchitis, emphysema, cor pulmonale, respiratory failure, interstitial lung disease, bronchiectasis, pneumosilicosis, pulmonary tuberculosis, pulmonary fibrosis, asthma, pleurisy, pleural effusion, etc.
Secondary associated vocabulary: time of onset, disease name, diagnosis and treatment hospital, current status
Three-level associated vocabularies: cured, improved and uncured
Set of atomized components: description information corresponding to radio button, time selection box and character input box
The first step is as follows: the insurance product description is input into the computer through the data input unit 100, and the natural language preprocessing module 210 of the structured logic generation unit 200 splits the document by taking paragraphs as tags, so that the insurance product description is classified as a logic unit 220.
The second step: the keyword analysis module 310 performs data splitting on the insurance product description section, i.e. the logic unit 220, by using a word segmentation algorithm to form a keyword set 340, i.e. a keyword set of "whether, treatment, disease, detailed description, respiratory system disease".
The third step: the preset keyword processing rule 330 in the keyword rule set 320 sets that the sentences containing the two keywords of "whether" and "detailed description" belong to the same sub-logic unit, so that the sub-logic unit "whether you have the following symptoms and were informed of the following diseases or receiving treatment, if yes, please describe in detail"; the preset keyword processing rule 330 further sets a section following the respiratory system disease to indicate a description of the disease, and extracts a second sub-logic unit, such as repeated cough, hemoptysis, asthma, dyspnea, chronic bronchitis, emphysema, pulmonary heart disease, respiratory failure, interstitial lung disease, bronchiectasis, pneumosilicosis, tuberculosis, pulmonary fibrosis, asthma, pleurisy, pleural effusion and the like.
The fourth step: the second sub-logic unit is provided with keywords of 'disease' and 'treatment', and is provided with a second-level associated vocabulary of 'attack time, disease name, diagnosis and treatment hospital, current condition' and a third-level associated vocabulary of 'cure, improvement and non-cure'. The sub-lun analysis module 410 determines the corresponding component type, such as time selection box and text input box, according to the associated vocabulary.
The fifth step: the first sub-logic unit has two keywords of 'yes' and 'detailed description', the corresponding display data are 'yes' and 'no', the display mode is text display, and the interaction mode is form operation.
And a sixth step: the sub-logical unit analysis module 410 takes the data of the sub-logical units and matches the description information of the atomized component library set 420. For example, if it is known that there are presentation data of "yes" and "no" and data of text presentation and form manipulation, it can be judged as a radio box button component. And (3) related logical units are associated in the sub logical units in the fourth step, the related logical units can be taken out independently for calculation and analysis, corresponding component types such as a time selection box, a radio box and a text input box are also built in the secondary related vocabulary and the tertiary related vocabulary, and the component types can be integrated with the data of the sub logical units to generate the data which really needs to be rendered.
The seventh step: the structured component tree generation unit 500 generates a tree structure from the data of the determined component type to form a structured component tree. The structured component tree contains basic information of types, interaction, data and the like of various components.
Eighth step: the Web page rendering unit 600 is configured to embed the atomization component library set 420, calculate a specific component to be rendered in the structured component tree through type matching, and then perform rendering on a front-end Web page according to information such as type, interaction, and data of the component, so as to form a page as shown in fig. 5. The rendering step is conventional in the art and will not be described in detail.
It will be understood by those skilled in the art that all or part of the steps carried out to implement the above-described implementation method can be implemented by hardware related to instructions of a program, which can be stored in a computer-readable recording medium, and the program, when executed, includes one or a combination of the steps of the method embodiments.

Claims (7)

1. A system for automatically generating a Web front end code from a natural language specification document, comprising a data input unit, a structured logic generating unit, a sub-logic generating unit, a component type calculating unit, a structured component tree generating unit, and a Web page rendering unit, wherein:
a data input unit for inputting a natural language specification document into a computer;
the structured logic generation unit comprises a natural language preprocessing module, and is used for splitting the natural language description document into logic units of natural language and marking the logic units;
the sub-logic generation unit comprises a keyword analysis module and a keyword rule set; the keyword analysis module performs data splitting on the logic unit by using a word segmentation algorithm to form a keyword set; the keyword rule set comprises preset keyword processing rules, display modes and interaction modes of the keywords; matching the keyword set according to a preset keyword processing rule, and extracting display data according to the matched keywords to form a sub-logic unit, wherein the sub-logic unit comprises three dimensions of display data, a display mode and an interaction mode;
the component type calculation unit comprises a sub logic unit analysis module and an atomization component library set; the atomization component library comprises description information of the characteristics of various components; the sub-logic unit analysis module matches the sub-logic unit with the description information, and determines the component type of the sub-logic unit after the matching is successful;
the structural component tree generating unit is used for nesting the matched sub logic units of the component types and the logic units into a tree structure to form a structural component tree;
and the Web page rendering unit is used for receiving the structured component tree and rendering the Web front-end page.
2. The system of claim 1, wherein the system is configured to automatically generate the web front end code from a natural language specification document, and wherein: the natural language preprocessing module splits the document according to one or more of paragraphs, major titles, minor titles, chinese character digital titles, arabic digital titles, periods, commas and semicolons of the natural language description document.
3. A system for automatically generating web front-end code from natural language specification documents according to claim 1 or 2, characterized in that: and the sub-logic generating unit performs similarity matching on the keyword set according to a preset keyword processing rule, wherein the similarity of successful matching is a dynamic value or a fixed value.
4. A system for automatically generating web front end code from natural language specification documents as claimed in claim 3, wherein: and in the sub-logic generation unit, a logic unit corresponding to the keyword set which is not successfully matched with the preset keyword processing rule is defined as a logic unit to be analyzed, the logic unit to be analyzed defines the keywords in a manual analysis mode, and the keywords are placed in the keyword rule set and are matched again.
5. The system of claim 4, wherein the system is configured to automatically generate the web front end code from the natural language specification document: the preset keyword processing rule comprises a keyword white list and a keyword blacklist, and when the keyword set is matched with the keyword white list, a sub-logic unit is generated; generating only additional information when the set of keywords matches the keyword blacklist.
6. A system for automatically generating web front end code from natural language description documents according to claim 1, 4 or 5, characterized in that: the sub logic unit also comprises an associated logic unit, wherein a secondary associated vocabulary and a tertiary associated vocabulary are preset in the associated logic unit according to the display data in the sub logic unit, and the sub logic unit analysis module determines the corresponding component type according to the secondary associated vocabulary and the tertiary associated vocabulary.
7. An application of the system for automatically generating Web front-end code according to any one of claims 1 to 7 in the Web development of insurance products.
CN202211285562.6A 2022-10-20 2022-10-20 System for automatically generating web front-end codes according to natural language description documents Pending CN115510362A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211285562.6A CN115510362A (en) 2022-10-20 2022-10-20 System for automatically generating web front-end codes according to natural language description documents

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211285562.6A CN115510362A (en) 2022-10-20 2022-10-20 System for automatically generating web front-end codes according to natural language description documents

Publications (1)

Publication Number Publication Date
CN115510362A true CN115510362A (en) 2022-12-23

Family

ID=84509509

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211285562.6A Pending CN115510362A (en) 2022-10-20 2022-10-20 System for automatically generating web front-end codes according to natural language description documents

Country Status (1)

Country Link
CN (1) CN115510362A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118012403A (en) * 2024-04-08 2024-05-10 西南林业大学 Low code development method, system and storage medium based on natural language processing

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118012403A (en) * 2024-04-08 2024-05-10 西南林业大学 Low code development method, system and storage medium based on natural language processing
CN118012403B (en) * 2024-04-08 2024-06-11 西南林业大学 Low code development method, system and storage medium based on natural language processing

Similar Documents

Publication Publication Date Title
US12019978B2 (en) Lean parsing: a natural language processing system and method for parsing domain-specific languages
JP7126542B2 (en) DATASET PROCESSING METHOD, APPARATUS, ELECTRONIC DEVICE AND STORAGE MEDIUM
US8452772B1 (en) Methods, systems, and articles of manufacture for addressing popular topics in a socials sphere
Wang et al. Bootstrapping both product features and opinion words from chinese customer reviews with cross-inducing
CN109753636A (en) Machine processing and text error correction method and device calculate equipment and storage medium
West et al. Reverse-engineering satire, or “paper on computational humor accepted despite making serious advances”
US9633008B1 (en) Cognitive presentation advisor
US11822909B2 (en) Adapting existing source code snippets to new contexts
RU2665261C1 (en) Recovery of text annotations related to information objects
CN105095190A (en) Chinese semantic structure and finely segmented word bank combination based emotional analysis method
US9224152B2 (en) System and method for intent mining
EP4364044A1 (en) Automated troubleshooter
CN113761377B (en) False information detection method and device based on attention mechanism multi-feature fusion, electronic equipment and storage medium
CN113841168A (en) Hierarchical machine learning architecture including a primary engine supported by distributed lightweight real-time edge engines
Kieffer et al. User interface design by sketching: a complexity analysis of widget representations
CN110929007A (en) Electric power marketing knowledge system platform and application method
CN114579104A (en) Data analysis scene generation method, device, equipment and storage medium
US11842154B2 (en) Visually correlating individual terms in natural language input to respective structured phrases representing the natural language input
CN113609838A (en) Document information extraction and mapping method and system
CN115510362A (en) System for automatically generating web front-end codes according to natural language description documents
Natalie et al. Supporting novices author audio descriptions via automatic feedback
EP4336379A1 (en) Tracking concepts within content in content management systems and adaptive learning systems
CN103646017A (en) Acronym generating system for naming and working method thereof
US20230154218A1 (en) Sequence labeling task extraction from inked content
JP6155409B1 (en) Financial analysis system and financial analysis program

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