CN113312880A - Text form conversion method and device and electronic equipment - Google Patents

Text form conversion method and device and electronic equipment Download PDF

Info

Publication number
CN113312880A
CN113312880A CN202110362881.1A CN202110362881A CN113312880A CN 113312880 A CN113312880 A CN 113312880A CN 202110362881 A CN202110362881 A CN 202110362881A CN 113312880 A CN113312880 A CN 113312880A
Authority
CN
China
Prior art keywords
text
building
target
building specification
attribute
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.)
Granted
Application number
CN202110362881.1A
Other languages
Chinese (zh)
Other versions
CN113312880B (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.)
Fenomen Array Beijing Technology Co ltd
Original Assignee
Fenomen Array Beijing Technology 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 Fenomen Array Beijing Technology Co ltd filed Critical Fenomen Array Beijing Technology Co ltd
Priority to CN202110362881.1A priority Critical patent/CN113312880B/en
Publication of CN113312880A publication Critical patent/CN113312880A/en
Application granted granted Critical
Publication of CN113312880B publication Critical patent/CN113312880B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/151Transformation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Machine Translation (AREA)

Abstract

The application discloses a text form conversion method and device and electronic equipment, and belongs to the technical field of buildings. The method comprises the following steps: acquiring a building specification text in a character form; performing semantic analysis processing on the building specification text to obtain an attribute text; performing function mapping processing on the attribute text to obtain a calculation function; performing language analysis processing on the attribute text based on the calculation function to obtain a target building specification text of a formal language; the target building specification text of the formal language is matched with the language form of the building information model, so that the problem that the workload of workers is large due to the fact that the workers need to have certain computer programming foundation and have professional building design knowledge because the workers enter the building design specification in advance into a computer system in the formal language capable of being processed by a computer is solved, and the efficiency and the reliability of automatically examining the building design by the electronic equipment are improved.

Description

Text form conversion method and device and electronic equipment
Technical Field
The application belongs to the technical field of buildings, and particularly relates to a text form conversion method and device and electronic equipment.
Background
Before building construction, a building design drawing needs to be checked by professional personnel to check whether the building design in the building design drawing completely meets the requirements of a series of building design specifications issued by the state.
Currently, with the application of a Building Information Model (BIM), a part of the specification review can be automatically completed by a machine (electronic device, such as a computer) provided with the BIM. The automatic examination of the architectural design by the machine is realized by pre-inputting architectural design specifications into a computer system by a worker in a form language which can be processed by a computer.
However, at present, the building design specifications are pre-recorded into a computer system by workers in a form language which can be processed by a computer, the workers need to have certain computer programming foundation and professional building design knowledge, and the building design specifications are frequently updated, so that the workload of the workers is large, and the efficiency and reliability of automatically examining the building design by a machine are reduced.
Disclosure of Invention
The embodiment of the application aims to provide a text form conversion method, a text form conversion device and electronic equipment, and can solve the problems that in the prior art, a tone conversion scheme damages the conversion effect of tone conversion and reduces the reliability of tone conversion.
In order to solve the technical problem, the present application is implemented as follows:
in a first aspect, an embodiment of the present application provides a text form conversion method, where the method includes:
acquiring a building specification text in a character form;
performing semantic analysis processing on the building specification text to obtain an attribute text;
performing function mapping processing on the attribute text to obtain a calculation function;
performing language analysis processing on the attribute text based on the calculation function to obtain a target building specification text of a formal language;
wherein the target building specification text of the formal language matches the language form of the building information model.
Optionally, after the performing language parsing processing on the attribute text based on the calculation function to obtain a target building specification text in a formal language, the method further includes:
under the condition that a latest building specification text is received and a latest target building specification text of a formal language is obtained, a target updated building specification sub-text corresponding to the same input and different in output result of the latest target building specification text and the target building specification text is obtained;
and updating the target updating building specification sub-text based on the latest target building specification text to obtain an updated target updating building specification text.
Optionally, the performing semantic parsing on the building specification text to obtain an attribute text includes:
and carrying out semantic analysis processing on the building specification text to obtain an attribute text in a slot value expression form.
Optionally, the performing language parsing processing on the attribute text based on the calculation function to obtain a target building specification text in a formal language includes:
performing language analysis processing on the attribute text based on the calculation function to obtain an abstract syntax tree;
and restoring the abstract syntax tree to obtain the target building standard text of the formal language.
In a second aspect, an embodiment of the present application provides a text form conversion apparatus, including:
the building specification text acquisition module is used for acquiring a building specification text in a character form;
the first analysis module is used for carrying out semantic analysis processing on the building specification text to obtain an attribute text;
the function mapping module is used for carrying out function mapping processing on the attribute text to obtain a calculation function;
the second analysis module is used for carrying out language analysis processing on the attribute text based on the calculation function to obtain a target building standard text of a formal language;
wherein the target building specification text of the formal language matches the language form of the building information model.
Optionally, the apparatus further comprises:
the sub-text acquisition module is used for acquiring a target updated building standard sub-text which corresponds to the same input and has different output results from the latest target building standard text and the target building standard text under the condition of receiving the latest building standard text and acquiring the latest target building standard text of a formal language;
and the updating module is used for updating the target updating building specification sub-text based on the latest target building specification text to obtain an updated target updating building specification text.
Optionally, the first parsing module includes:
and the first analysis submodule is used for carrying out semantic analysis processing on the building specification text to obtain an attribute text in a slot value expression form.
Optionally, the second parsing module includes:
the second analysis submodule is used for carrying out language analysis processing on the attribute text based on the calculation function to obtain an abstract syntax tree;
and the processing submodule is used for reducing the abstract syntax tree to obtain the target building standard text of the formal language.
In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instructions stored on the memory and executable on the processor, and when executed by the processor, the program or instructions implement the text form conversion method according to the first aspect.
In a fourth aspect, the present invention provides a readable storage medium, on which a program or instructions are stored, which when executed by a processor implement the text form conversion method according to the first aspect.
In a fifth aspect, an embodiment of the present application provides a chip, where the chip includes a processor and a communication interface, where the communication interface is coupled to the processor, and the processor is configured to execute a program or instructions to implement the text form conversion method according to the first aspect.
In the embodiment of the application, the building specification text in a character form is obtained; performing semantic analysis processing on the building specification text to obtain an attribute text; performing function mapping processing on the attribute text to obtain a calculation function; performing language analysis processing on the attribute text based on the calculation function to obtain a target building specification text of a formal language; the target building standard text of the formal language is matched with the language form of the building information model, so that the electronic equipment can automatically convert the building standard text of the character form into the target building standard text of the formal language which can be identified by a computer, the problem that the workload of a worker is large because the worker needs to have certain computer programming basis and professional building design knowledge to pre-input the building design standard into a computer system in the formal language which can be processed by the computer is solved, and the efficiency and the reliability of automatically examining the building design by the electronic equipment are improved.
Drawings
Fig. 1 is a flowchart illustrating steps of a text format conversion method according to an embodiment of the present application;
fig. 2 is a flowchart illustrating steps of a text format conversion method according to a second embodiment of the present application;
fig. 3 is a schematic structural diagram of a text format conversion apparatus according to a third embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms first, second and the like in the description and in the claims of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application are capable of operation in sequences other than those illustrated or described herein. In addition, "and/or" in the specification and claims means at least one of connected objects, a character "/" generally means that a preceding and succeeding related objects are in an "or" relationship.
The parameter adjustment scheme provided by the embodiment of the present application is described in detail below with reference to the accompanying drawings through specific embodiments and application scenarios thereof.
Referring to fig. 1, a flowchart illustrating steps of a text format conversion method provided in an embodiment of the present application is shown, and as shown in fig. 1, the text format conversion method may specifically include the following steps:
step 101: and acquiring a building specification text in a character form.
In the application, the user may input the building specification text in a text form to the electronic device, may also input the building specification text in a text form to the electronic device in a mode of image recognition and character recognition, and may also input the building specification text in a text form to the electronic device in other modes, which is not limited in the embodiment of the application.
The building specification texts are some requirement texts about building design specifications issued by the country.
After the building specification text is obtained in text form, step 102 is performed.
Step 102: and carrying out semantic analysis processing on the building specification text to obtain an attribute text.
In the application, the building specification text can be analyzed through a semantic analyzer to obtain a text in a slot-value expression form, namely an attribute text.
The values may be normalized, for example, the evacuation door and the safe exit may be normalized to the evacuation door. The building specification text can be analyzed by adopting a context-free method model, a sequence labeling model or other relevant semantic analyzers, which are not specifically limited in the embodiment of the application and can be specifically adjusted and calibrated according to actual application scenes.
For example, the building specification text may include: when the building area of any floor of the residential building unit is more than 650 square meters (m2), or the distance between the door of any household and the safety exit is more than 15 meters, the number of the safety place leakage of each floor of the building unit is not less than 2. The attribute text obtained after performing semantic parsing processing on the attribute text may include:
{BUILDING.TYPE=RESIDENCE}{STATEMENT=EACH_LEVEL}{CONS TRAINT.ELEMENT=FLOOR_AREA}{OPERATOR=GT}
{VALUE=650,UNIT=m2},
{LOGIC_FUNCTION=OR}{STATEMENT=EACH_ROOM}{CONSTRAINT .ELEMENT=DOOR}{CONSTRAINT.ELEMENT=FIRE_EXIT}{CONSTRAINT. RELATION=DISTANCE}{OPERATOR=GT}{VALUE=15,UNIT=m}
{STATEMENT=IF_END},
{ STATEMENT ═ EACH _ LEVEL } { constraint ═ element } { LOGIC _ failure } { LOGIC _ FUNCTION ═ NOT } { OPERATOR ═ LT } { VALUE ═ 2 }. Wherein the content of the first and second substances,
{ building. type ═ RESIDENCE } denotes [ residential building unit ];
{ STATEMENT ═ EACH _ LEVEL } denotes [ any layer ];
{ constraint. element ═ FLOOR _ AREA } denotes [ building AREA ];
{ OPERATOR ═ GT } denotes [ > GT ];
{ VALUE 650, UNIT m2} denotes [ 650m2 ];
{ LOGIC _ FUNCTION ═ OR } represents [ OR ];
{ STATEMENT ═ EACH _ ROOM } denotes [ any household ];
{ constraint. element ═ DOOR } denotes [ house gate ];
{ construction element ═ FIRE _ EXIT } denotes [ security EXIT ];
{ constraint. relative } denotes [ DISTANCE ];
{ OPERATOR ═ GT } denotes [ > GT ];
{ VALUE 15, UNIT m } indicates [ 15 m ];
{ STATEMENT ═ IF _ END } denotes [ time ];
{ STATEMENT ═ EACH layer } denotes [ EACH layer ];
{ construction element ═ FIRE _ EXIT } denotes [ security EXIT ];
{ LOGIC _ FUNCTION ═ NOT } indicates [ should ];
{ OPERATOR ═ LT } - [ less than ];
{ VALUE ═ 2} indicates [ 2 ].
It should be understood that the above examples are only examples for better understanding of the technical solutions of the embodiments of the present application, and are not to be taken as the only limitation to the embodiments.
A frame may be composed of a plurality of structures called slots, each slot may be divided into a plurality of sides according to actual needs, a slot may be used to describe an attribute of a certain aspect of an object, a side may describe an aspect of a corresponding attribute by a user, and attribute values of a slot and a side are respectively called a slot value and a side value.
After semantic parsing processing is performed on the building specification text to obtain an attribute text, step 103 is executed.
Step 103: and performing function mapping processing on the attribute text to obtain a calculation function.
In the present application, a specific attribute text may be mapped to a calculation function according to a predefined dictionary, i.e. a specific slot-value may be mapped to a calculation function according to a predefined dictionary.
For example, { connection.relationship } may represent DISTANCE, mapped to a function DISTANCE (element1, element2, unit), where element1 is the starting point building element, element2 is the ending point building element, and unit is the unit of the return value.
After the function mapping process is performed on the attribute text to obtain a calculation function, step 104 is executed.
Step 104: and carrying out language analysis processing on the attribute text based on the calculation function to obtain a target building specification text of a formal language.
Wherein the target building specification text of the formal language matches the language form of the building information model.
In the application, language parsing processing can be performed on the attribute text based on the calculation function to obtain an abstract syntax tree; and restoring the abstract syntax tree to obtain the target building standard text of the formal language.
Specifically, the attribute text may be parsed into an Abstract Syntax Tree (AST) based on a computation function, where the parsing is based on a Syntax predetermined in a formal language interpreter, each value in each slot-value in the attribute text corresponds to a node on the AST, each slot defines a type of the node, and types and numbers of child nodes that can be accepted by each node can be defined in advance according to actual needs. The expression parsing of the AST may be performed by a priority hill Climbing (Precedence Climbing) algorithm, and the program statement parsing of the AST may be performed by a Recursive (Recursive) algorithm. And then, the AST is reduced to obtain a target building standard text of the formal language.
By way of example, the building specification text may include: when the building area of any floor of the residential building unit is more than 650 square meters (m2), or the distance from the door of any household to the safety exit is more than 15 meters, the number of safety leaks of each floor of the building unit is not less than 2, and the building unit is converted into the following conditions:
IF building.type==RESIDENCE:
FOR EACH level IN building:
IF floor_area(level,unit=’m2’)>650:
return NOT Count(level.fire_exit)<2
FOR EACH room IN level:
If Distance(room.door,level.fire_exit,unit=’m’)>15:
return NOT Count(level.fire_exit)<2。
it should be noted that the formal language computation objects may not be unique, and the formal language parser may automatically develop the formal language rules into computations for each possible object. Whether the calculation object is unique can be judged according to a predefined rule. For example, when level.fire _ exit and room.door are not the only objects, they will be converted to:
IF building.type==RESIDENCE:
FOR EACH level IN building:
IF floor_area(level,unit=’m2’)>650:
return NOT Count(level.fire_exit)<2
FOR EACH room IN level:
FOR EACH fire_exit IN level:
FOR EACH door IN room:
IF Distance(door,fire_exit,unit=’m’)>15
return NOT Count(level.fire_exit)<2。
the text form conversion method provided by the embodiment of the application obtains the building standard text in a character form; performing semantic analysis processing on the building specification text to obtain an attribute text; performing function mapping processing on the attribute text to obtain a calculation function; performing language analysis processing on the attribute text based on the calculation function to obtain a target building specification text of a formal language; the target building standard text of the formal language is matched with the language form of the building information model, so that the electronic equipment can automatically convert the building standard text of the character form into the target building standard text of the formal language which can be identified by a computer, the problem that the workload of a worker is large because the worker needs to have certain computer programming basis and professional building design knowledge to pre-input the building design standard into a computer system in the formal language which can be processed by the computer is solved, and the efficiency and the reliability of automatically examining the building design by the electronic equipment are improved.
Referring to fig. 2, a flowchart illustrating steps of a text format conversion method provided in the second embodiment of the present application is shown, where the text format conversion method is applied to an electronic device, and as shown in fig. 2, the text format conversion method may specifically include the following steps:
step 201: and acquiring a building specification text in a character form.
In the application, the user may input the building specification text in a text form to the electronic device, may also input the building specification text in a text form to the electronic device in a mode of image recognition and character recognition, and may also input the building specification text in a text form to the electronic device in other modes, which is not limited in the embodiment of the application.
The building specification texts are some requirement texts about building design specifications issued by the country.
After the building specification text is obtained in text form, step 202 is performed.
Step 202: and carrying out semantic analysis processing on the building specification text to obtain an attribute text.
And carrying out semantic analysis processing on the building specification text to obtain an attribute text in a slot value expression form.
In the application, the building specification text can be analyzed through a semantic analyzer to obtain a text in a slot-value expression form, namely an attribute text.
The values may be normalized, for example, the evacuation door and the safe exit may be normalized to the evacuation door. The building specification text can be analyzed by adopting a context-free method model, a sequence labeling model or other relevant semantic analyzers, which are not specifically limited in the embodiment of the application and can be specifically adjusted and calibrated according to actual application scenes.
For example, the building specification text may include: when the building area of any floor of the residential building unit is more than 650 square meters (m2), or the distance between the door of any household and the safety exit is more than 15 meters, the number of the safety place leakage of each floor of the building unit is not less than 2. The attribute text obtained after performing semantic parsing processing on the attribute text may include:
{BUILDING.TYPE=RESIDENCE}{STATEMENT=EACH_LEVEL}{CONS TRAINT.ELEMENT=FLOOR_AREA}{OPERATOR=GT}
{VALUE=650,UNIT=m2},
{LOGIC_FUNCTION=OR}{STATEMENT=EACH_ROOM}{CONSTRAINT .ELEMENT=DOOR}{CONSTRAINT.ELEMENT=FIRE_EXIT}{CONSTRAINT. RELATION=DISTANCE}{OPERATOR=GT}{VALUE=15,UNIT=m}
{STATEMENT=IF_END},
{ STATEMENT ═ EACH _ LEVEL } { constraint ═ element } { LOGIC _ failure } { LOGIC _ FUNCTION ═ NOT } { OPERATOR ═ LT } { VALUE ═ 2 }. Wherein the content of the first and second substances,
{ building. type ═ RESIDENCE } denotes [ residential building unit ];
{ STATEMENT ═ EACH _ LEVEL } denotes [ any layer ];
{ constraint. element ═ FLOOR _ AREA } denotes [ building AREA ];
{ OPERATOR ═ GT } denotes [ > GT ];
{ VALUE 650, UNIT m2} denotes [ 650m2 ];
{ LOGIC _ FUNCTION ═ OR } represents [ OR ];
{ STATEMENT ═ EACH _ ROOM } denotes [ any household ];
{ constraint. element ═ DOOR } denotes [ house gate ];
{ construction element ═ FIRE _ EXIT } denotes [ security EXIT ];
{ constraint. relative } denotes [ DISTANCE ];
{ OPERATOR ═ GT } denotes [ > GT ];
{ VALUE 15, UNIT m } indicates [ 15 m ];
{ STATEMENT ═ IF _ END } denotes [ time ];
{ STATEMENT ═ EACH layer } denotes [ EACH layer ];
{ construction element ═ FIRE _ EXIT } denotes [ security EXIT ];
{ LOGIC _ FUNCTION ═ NOT } indicates [ should ];
{ OPERATOR ═ LT } - [ less than ];
{ VALUE ═ 2} indicates [ 2 ].
It should be understood that the above examples are only examples for better understanding of the technical solutions of the embodiments of the present application, and are not to be taken as the only limitation to the embodiments.
A frame may be composed of a plurality of structures called slots, each slot may be divided into a plurality of sides according to actual needs, a slot may be used to describe an attribute of a certain aspect of an object, a side may describe an aspect of a corresponding attribute by a user, and attribute values of a slot and a side are respectively called a slot value and a side value.
After semantic parsing is performed on the building specification text to obtain an attribute text, step 203 may be performed.
Step 203: and performing function mapping processing on the attribute text to obtain a calculation function.
In the present application, a specific attribute text may be mapped to a calculation function according to a predefined dictionary, i.e. a specific slot-value may be mapped to a calculation function according to a predefined dictionary.
For example, { connection.relationship } may represent DISTANCE, mapped to a function DISTANCE (element1, element2, unit), where element1 is the starting point building element, element2 is the ending point building element, and unit is the unit of the return value.
And performing function mapping processing on the attribute text to obtain a calculation function, and further executing step 204.
Step 204: and carrying out language analysis processing on the attribute text based on the calculation function to obtain a target building specification text of a formal language.
Wherein the target building specification text of the formal language matches the language form of the building information model.
In the application, language parsing processing can be performed on the attribute text based on the calculation function to obtain an abstract syntax tree; and restoring the abstract syntax tree to obtain the target building standard text of the formal language.
Specifically, the attribute text may be parsed into an Abstract Syntax Tree (AST) based on a computation function, where the parsing is based on a Syntax predetermined in a formal language interpreter, each value in each slot-value in the attribute text corresponds to a node on the AST, each slot defines a type of the node, and types and numbers of child nodes that can be accepted by each node can be defined in advance according to actual needs. The expression parsing of the AST may be performed by a priority hill Climbing (Precedence Climbing) algorithm, and the program statement parsing of the AST may be performed by a Recursive (Recursive) algorithm. And then, the AST is reduced to obtain a target building standard text of the formal language.
By way of example, the building specification text may include: when the building area of any floor of the residential building unit is more than 650 square meters (m2), or the distance from the door of any household to the safety exit is more than 15 meters, the number of safety leaks of each floor of the building unit is not less than 2, and the building unit is converted into the following conditions:
IF building.type==RESIDENCE:
FOR EACH level IN building:
IF floor_area(level,unit=’m2’)>650:
return NOT Count(level.fire_exit)<2
FOR EACH room IN level:
If Distance(room.door,level.fire_exit,unit=’m’)>15:
return NOT Count(level.fire_exit)<2。
it should be noted that the formal language computation objects may not be unique, and the formal language parser may automatically develop the formal language rules into computations for each possible object. Whether the calculation object is unique can be judged according to a predefined rule. For example, when level.fire _ exit and room.door are not the only objects, they will be converted to:
IF building.type==RESIDENCE:
FOR EACH level IN building:
IF floor_area(level,unit=’m2’)>650:
return NOT Count(level.fire_exit)<2
FOR EACH room IN level:
FOR EACH fire_exit IN level:
FOR EACH door IN room:
IF Distance(door,fire_exit,unit=’m’)>15
return NOT Count(level.fire_exit)<2。
step 205 may be executed after performing language parsing processing on the attribute text based on the calculation function to obtain a target building specification text in a formal language.
Step 205: and under the condition that the latest building specification text is received and the latest target building specification text of the formal language is obtained, acquiring target updated building specification sub-texts which correspond to the same input and have different output results from the latest target building specification text and the target building specification text.
Because the building specification text duration is updated, when the latest building specification text is received, the latest target building specification text in the formal language can be obtained according to the step 201 and the step 204, whether the output results of the previous target building specification text and the latest target building specification text are the same for the same input is checked, and if different results occur, the target updated building specification sub-text with different results is determined.
After the latest building specification text is received and the latest target building specification text in the formal language is obtained, the target updated building specification sub-text corresponding to the same input and having different output results from the latest target building specification text and the target building specification text is obtained, and step 206 is executed.
Step 206: and updating the target updating building specification sub-text based on the latest target building specification text to obtain an updated target updating building specification text.
Because the building specification text is updated in time length, when the latest building specification text is received, the latest target building specification text in the formal language can be obtained according to the step 201 and 204, whether the output results of the previous target building specification text and the latest target building specification text are the same for the same input is checked, if different results occur, the target updated building specification sub-text with different results is determined, and the target updated building specification sub-text is updated by the latest target building specification text to replace the target building specification text. The problem that the task load of workers is large due to frequent updating of the architectural design specifications can be solved, the task load of the workers is reduced, and the efficiency and the reliability of automatic map examination of the machine on the architectural design are improved.
It should be noted that, for a formal language code generated by a specification, in order to ensure that a combination of different attributes is effectively constructed to verify each logical branch of the formal language code, in the present application, a test case may be automatically generated Based on a Search Based Software Testing (SBST) method. The specific algorithm can include a hill climbing algorithm, a simulated annealing algorithm, a genetic algorithm and the like, and the algorithm is not limited in the embodiment of the application and can be calibrated and adjusted according to the actual application scene.
The text form conversion method provided by the embodiment of the application obtains the building standard text in a character form; performing semantic analysis processing on the building specification text to obtain an attribute text; performing function mapping processing on the attribute text to obtain a calculation function; performing language analysis processing on the attribute text based on the calculation function to obtain a target building specification text of a formal language; the target building standard text of the formal language is matched with the language form of the building information model, so that the electronic equipment can automatically convert the building standard text of the character form into the target building standard text of the formal language which can be identified by a computer, the problem that the workload of a worker is large because the worker needs to have certain computer programming basis and professional building design knowledge to pre-input the building design standard into a computer system in the formal language which can be processed by the computer is solved, and the efficiency and the reliability of automatically examining the building design by the electronic equipment are improved.
It should be noted that, in the text form conversion method provided in the embodiment of the present application, the execution main body may be a text form conversion device, or a control module in the text form conversion device for executing the loaded text form conversion method. In the embodiment of the present application, a text form conversion device executes a method for converting a loaded text form as an example, and the method for converting a text form provided in the embodiment of the present application is described.
Referring to fig. 3, a schematic structural diagram of a text form conversion apparatus provided in a third embodiment of the present application is shown, where the text form conversion apparatus may be applied to an electronic device, and as shown in fig. 3, the text form conversion apparatus may specifically include the following modules:
a building specification text acquisition module 301, configured to acquire a building specification text in a text form;
the first parsing module 302 is configured to perform semantic parsing on the building specification text to obtain an attribute text;
a function mapping module 303, configured to perform function mapping processing on the attribute text to obtain a calculation function;
the second analysis module 304 is configured to perform language analysis processing on the attribute text based on the calculation function to obtain a target building specification text in a formal language;
wherein the target building specification text of the formal language matches the language form of the building information model.
Optionally, the apparatus further comprises:
the sub-text acquisition module is used for acquiring a target updated building standard sub-text which corresponds to the same input and has different output results from the latest target building standard text and the target building standard text under the condition of receiving the latest building standard text and acquiring the latest target building standard text of a formal language;
and the updating module is used for updating the target updating building specification sub-text based on the latest target building specification text to obtain an updated target updating building specification text.
Optionally, the first parsing module includes:
and the first analysis submodule is used for carrying out semantic analysis processing on the building specification text to obtain an attribute text in a slot value expression form.
Optionally, the second parsing module includes:
the second analysis submodule is used for carrying out language analysis processing on the attribute text based on the calculation function to obtain an abstract syntax tree;
and the processing submodule is used for reducing the abstract syntax tree to obtain the target building standard text of the formal language.
The text form conversion device provided by the embodiment of the application acquires the building specification text in a character form; performing semantic analysis processing on the building specification text to obtain an attribute text; performing function mapping processing on the attribute text to obtain a calculation function; performing language analysis processing on the attribute text based on the calculation function to obtain a target building specification text of a formal language; the target building standard text of the formal language is matched with the language form of the building information model, so that the electronic equipment can automatically convert the building standard text of the character form into the target building standard text of the formal language which can be identified by a computer, the problem that the workload of a worker is large because the worker needs to have certain computer programming basis and professional building design knowledge to pre-input the building design standard into a computer system in the formal language which can be processed by the computer is solved, and the efficiency and the reliability of automatically examining the building design by the electronic equipment are improved.
The text form conversion device in the embodiment of the present application may be a device, or may be a component, an integrated circuit, or a chip in a terminal. The device can be mobile electronic equipment or non-mobile electronic equipment. By way of example, the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a palm top computer, a vehicle-mounted electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a Personal Digital Assistant (PDA), and the like, and the non-mobile electronic device may be a server, a Network Attached Storage (NAS), a Personal Computer (PC), a Television (TV), a teller machine or a self-service machine, and the like, and the embodiments of the present application are not particularly limited.
The text form conversion apparatus in the embodiment of the present application may be an apparatus having an operating system. The operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, and embodiments of the present application are not limited specifically.
The text form conversion device provided in the embodiment of the present application can implement each process implemented by the text form conversion method in the method embodiments of fig. 1 to fig. 3, and is not described here again to avoid repetition.
Based on the same inventive concept, another embodiment of the present application provides a readable storage medium, on which a computer program is stored, which when executed by a processor implements the steps in the method for text form conversion according to any of the above embodiments of the present application.
Based on the same inventive concept, another embodiment of the present application provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and running on the processor, and when the processor executes the computer program, the electronic device implements the steps of the method for converting text forms according to any of the above embodiments of the present application.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
The embodiments in the present specification are described in a progressive or descriptive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one of skill in the art, embodiments of the present application may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, apparatus, and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present application have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including the preferred embodiment and all such alterations and modifications as fall within the true scope of the embodiments of the application.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The method, system, device and storage medium for text format conversion provided by the present application are introduced in detail, and the above description of the embodiments is only used to help understand the method and the core idea of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. A text form conversion method, comprising:
acquiring a building specification text in a character form;
performing semantic analysis processing on the building specification text to obtain an attribute text;
performing function mapping processing on the attribute text to obtain a calculation function;
performing language analysis processing on the attribute text based on the calculation function to obtain a target building specification text of a formal language;
wherein the target building specification text of the formal language matches the language form of the building information model.
2. The method according to claim 1, after the performing language parsing processing on the attribute text based on the calculation function to obtain a target building specification text in a formal language, further comprising:
under the condition that a latest building specification text is received and a latest target building specification text of a formal language is obtained, a target updated building specification sub-text corresponding to the same input and different in output result of the latest target building specification text and the target building specification text is obtained;
and updating the target updating building specification sub-text based on the latest target building specification text to obtain an updated target updating building specification text.
3. The method according to claim 1, wherein the semantic parsing the building specification text to obtain an attribute text comprises:
and carrying out semantic analysis processing on the building specification text to obtain an attribute text in a slot value expression form.
4. The method according to claim 1, wherein the performing language parsing processing on the attribute text based on the calculation function to obtain a target building specification text in a formal language comprises:
performing language analysis processing on the attribute text based on the calculation function to obtain an abstract syntax tree;
and restoring the abstract syntax tree to obtain the target building standard text of the formal language.
5. A text form conversion apparatus, comprising:
the building specification text acquisition module is used for acquiring a building specification text in a character form;
the first analysis module is used for carrying out semantic analysis processing on the building specification text to obtain an attribute text;
the function mapping module is used for carrying out function mapping processing on the attribute text to obtain a calculation function;
the second analysis module is used for carrying out language analysis processing on the attribute text based on the calculation function to obtain a target building standard text of a formal language;
wherein the target building specification text of the formal language matches the language form of the building information model.
6. The apparatus of claim 5, further comprising:
the sub-text acquisition module is used for acquiring a target updated building standard sub-text which corresponds to the same input and has different output results from the latest target building standard text and the target building standard text under the condition of receiving the latest building standard text and acquiring the latest target building standard text of a formal language;
and the updating module is used for updating the target updating building specification sub-text based on the latest target building specification text to obtain an updated target updating building specification text.
7. The apparatus of claim 5, wherein the first parsing module comprises:
and the first analysis submodule is used for carrying out semantic analysis processing on the building specification text to obtain an attribute text in a slot value expression form.
8. The apparatus of claim 5, wherein the second parsing module comprises:
the second analysis submodule is used for carrying out language analysis processing on the attribute text based on the calculation function to obtain an abstract syntax tree;
and the processing submodule is used for reducing the abstract syntax tree to obtain the target building standard text of the formal language.
9. An electronic device comprising a processor, a memory, and a program or instructions stored on the memory and executable on the processor, the program or instructions when executed by the processor implementing the text form conversion method of any one of claims 1 to 4.
10. A readable storage medium, characterized in that a program or instructions is stored thereon, which when executed by a processor implements the text form conversion method of any one of claims 1 to 4.
CN202110362881.1A 2021-04-02 2021-04-02 Text form conversion method and device and electronic equipment Active CN113312880B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110362881.1A CN113312880B (en) 2021-04-02 2021-04-02 Text form conversion method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110362881.1A CN113312880B (en) 2021-04-02 2021-04-02 Text form conversion method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN113312880A true CN113312880A (en) 2021-08-27
CN113312880B CN113312880B (en) 2024-01-26

Family

ID=77372094

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110362881.1A Active CN113312880B (en) 2021-04-02 2021-04-02 Text form conversion method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN113312880B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100275179A1 (en) * 2009-04-23 2010-10-28 International Business Machines Corporation Extracting a system modelling meta-model language model for a system from a natural language specification of the system
CN107943481A (en) * 2017-05-23 2018-04-20 清华大学 C programmer code specification building method based on multi-model
CN109255209A (en) * 2017-07-13 2019-01-22 阿里巴巴集团控股有限公司 A kind of data processing method, device, equipment and storage medium
CN109783507A (en) * 2018-12-25 2019-05-21 国网浙江省电力有限公司经济技术研究院 The automatic auditing method and system of substation project clearance compliance
CN111814434A (en) * 2020-07-06 2020-10-23 清华大学 Device and method for automatically generating building standardized structured rules
CN112446203A (en) * 2020-11-25 2021-03-05 深圳供电局有限公司 Method for generating architecture transformation grindable standard clause structure
CN112560151A (en) * 2020-12-22 2021-03-26 中设数字技术股份有限公司 BIM (building information modeling) model intelligent auditing method and system based on resource description framework

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100275179A1 (en) * 2009-04-23 2010-10-28 International Business Machines Corporation Extracting a system modelling meta-model language model for a system from a natural language specification of the system
CN107943481A (en) * 2017-05-23 2018-04-20 清华大学 C programmer code specification building method based on multi-model
CN109255209A (en) * 2017-07-13 2019-01-22 阿里巴巴集团控股有限公司 A kind of data processing method, device, equipment and storage medium
CN109783507A (en) * 2018-12-25 2019-05-21 国网浙江省电力有限公司经济技术研究院 The automatic auditing method and system of substation project clearance compliance
CN111814434A (en) * 2020-07-06 2020-10-23 清华大学 Device and method for automatically generating building standardized structured rules
CN112446203A (en) * 2020-11-25 2021-03-05 深圳供电局有限公司 Method for generating architecture transformation grindable standard clause structure
CN112560151A (en) * 2020-12-22 2021-03-26 中设数字技术股份有限公司 BIM (building information modeling) model intelligent auditing method and system based on resource description framework

Also Published As

Publication number Publication date
CN113312880B (en) 2024-01-26

Similar Documents

Publication Publication Date Title
US10983789B2 (en) Systems and methods for automating and monitoring software development operations
CN109739494B (en) Tree-LSTM-based API (application program interface) use code generation type recommendation method
US11327874B1 (en) System, method, and computer program for orchestrating automatic software testing
EP4322009A1 (en) Test case generation method, apparatus and device
US20130125098A1 (en) Transformation of Computer Programs
KR20160122452A (en) Deep learnig framework and image recognition method for content-based visual image recognition
CN108255837B (en) SQL parser and method
CN113032862B (en) Building information model checking method and device and terminal equipment
CN111181805B (en) Micro-service test baffle generation method and system based on test case
CN108804315B (en) Test method and device applied to dynamic development, electronic equipment and storage medium
CN112559344A (en) Remote mock testing method and system
CN111580821B (en) Script binding method and device, electronic equipment and computer readable storage medium
CN113312880B (en) Text form conversion method and device and electronic equipment
CN110716859A (en) Method for automatically pushing test cases for modified codes and related device
CN114153447B (en) Automatic AI training code generation method
CN113688134A (en) Visual variable management method, system and equipment based on multidimensional data
CN115470095A (en) Test method, test system, electronic equipment and computer storage medium
CN112307751A (en) Data desensitization method and system based on natural language processing
CN112162738B (en) Data conversion method and device, terminal equipment and storage medium
CN112799956B (en) Asset identification capability test method, device and system device
KR101976167B1 (en) Method and Apparatus for Verifying Missing Relationship of Program Source and DB Schema
CN117573848B (en) Dialogue method, dialogue device, electronic equipment and medium
CN116991459B (en) Software multi-defect information prediction method and system
CN117709338A (en) Interactive text recognition method and device, electronic equipment and readable storage medium
CN115857939A (en) Statement validity checking method and device, electronic equipment and 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