CN113312880B - Text form conversion method and device and electronic equipment - Google Patents
Text form conversion method and device and electronic equipment Download PDFInfo
- Publication number
- CN113312880B CN113312880B CN202110362881.1A CN202110362881A CN113312880B CN 113312880 B CN113312880 B CN 113312880B CN 202110362881 A CN202110362881 A CN 202110362881A CN 113312880 B CN113312880 B CN 113312880B
- Authority
- CN
- China
- Prior art keywords
- text
- building
- language
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 57
- 238000006243 chemical reaction Methods 0.000 title claims abstract description 46
- 230000006870 function Effects 0.000 claims abstract description 71
- 238000012545 processing Methods 0.000 claims abstract description 71
- 238000004458 analytical method Methods 0.000 claims abstract description 50
- 238000004364 calculation method Methods 0.000 claims abstract description 46
- 238000013507 mapping Methods 0.000 claims abstract description 20
- 230000008569 process Effects 0.000 claims description 10
- 230000009467 reduction Effects 0.000 claims description 9
- 238000002372 labelling Methods 0.000 claims description 4
- 238000013461 design Methods 0.000 abstract description 28
- 238000004590 computer program Methods 0.000 description 9
- 238000004422 calculation algorithm Methods 0.000 description 8
- 238000010586 diagram Methods 0.000 description 8
- 230000009194 climbing Effects 0.000 description 5
- 230000009471 action Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000004891 communication Methods 0.000 description 2
- 230000004075 alteration Effects 0.000 description 1
- 238000012550 audit Methods 0.000 description 1
- 238000009435 building construction Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000002068 genetic effect Effects 0.000 description 1
- 238000007689 inspection Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 238000002922 simulated annealing Methods 0.000 description 1
- 238000013522 software testing Methods 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/30—Semantic analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/12—Use of codes for handling textual entities
- G06F40/151—Transformation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/205—Parsing
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE 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/00—Energy 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 building standard texts in a text form; carrying out 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 in a form language; the target building specification text of the formal language is matched with the language form of the building information model, the problem that the staff has a certain computer programming basis and special building design knowledge, so that the task amount of the staff is large is solved, and the efficiency and reliability of automatically examining the building design by the electronic equipment are improved.
Description
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, the building design drawing needs to be checked by professional staff 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 country.
Currently, with the application of Building Information Models (BIMs), a portion of specification audits have been automatically completed by machines (electronic devices, such as computers) provided with the BIMs. The machine automatically performs drawing examination on the building design, and a worker inputs the building design specification into a computer system in a form language mode which can be processed by the computer.
However, at present, a worker inputs a building design specification into a computer system in advance in a form language which can be processed by the computer, the worker is required to have a certain computer programming basis and have professional building design knowledge, and the building design specification is frequently updated, so that the task amount of the worker 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, which can solve the problems that in the prior art, a tone color conversion scheme damages the conversion effect of tone color conversion and reduces the reliability of tone color conversion.
In order to solve the technical problems, the application is realized as follows:
in a first aspect, an embodiment of the present application provides a text form conversion method, including:
acquiring building standard texts in a text form;
carrying out 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 in a form language;
wherein the target building specification text of the formal language is matched with the language form of the building information model.
Optionally, after the language parsing processing is performed on the attribute text based on the computing function to obtain the target building specification text in the form language, the method further includes:
under the condition that the latest building standard text is received and the latest target building standard text of the formal language is obtained, acquiring target updated building standard sub-texts which correspond to the same input and have different output results from the latest target building standard text and the target building standard text;
updating the target updated building specification sub-text based on the latest target building specification text to obtain an updated target updated building specification text.
Optionally, the performing semantic analysis processing 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 language analysis processing is performed on the attribute text based on the calculation function to obtain a target building specification text in a form language, including:
performing language analysis processing on the attribute text based on the calculation function to obtain an abstract syntax tree;
and carrying out reduction processing on the abstract syntax tree to obtain the target building specification text of the formal language.
In a second aspect, an embodiment of the present application provides a text form conversion device, including:
the building standard text acquisition module is used for acquiring building standard texts in a text 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 performing 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 specification text in a form language;
wherein the target building specification text of the formal language is matched with the language form of the building information model.
Optionally, the apparatus further comprises:
the sub-text acquisition module is used for acquiring target updated building specification sub-texts corresponding to the same input under the condition that the latest building specification text is received and the latest target building specification text of a formal language is obtained, wherein the output results of the latest target building specification text and the target building specification text are different;
and the updating module is used for updating the target updated building specification sub-text based on the latest target building specification text to obtain an updated target updated 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 sub-module is used for carrying out reduction processing on the abstract syntax tree to obtain the target building specification text of the formal language.
In a third aspect, an embodiment of the present application provides an electronic device, where the electronic device includes a processor, a memory, and a program or an instruction stored on the memory and executable on the processor, where the program or the instruction is executed by the processor to implement the text form conversion method according to the first aspect.
In a fourth aspect, embodiments of the present application provide a readable storage medium having stored thereon a program or instructions which, when executed by a processor, implement the text form conversion method according to the first aspect.
In a fifth aspect, embodiments of the present application provide 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, building standard texts in a text form are obtained; carrying out 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 in a form language; the electronic equipment can automatically convert the building standard text in a word form into the target building standard text in a form language which can be recognized by a computer, the situation that a worker inputs a building design standard in advance in a form language which can be processed by the computer into a computer system is avoided, the worker is required to have a certain computer programming basis and have professional building design knowledge, the problem of large task amount of the worker is solved, and the efficiency and reliability of automatically carrying out aesthetic drawing on the building design by the electronic equipment are improved.
Drawings
Fig. 1 is a flowchart of a text form conversion method according to an embodiment of the present application;
fig. 2 is a flowchart of a text form conversion method according to a second embodiment of the present application;
fig. 3 is a schematic structural diagram of a text format conversion device according to a third embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
The terms first, second and the like in the description and in the claims, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that embodiments of the present application may be implemented in sequences other than those illustrated or described herein. Furthermore, in the description and claims, "and/or" means at least one of the connected objects, and the character "/", generally means that the associated object is an "or" relationship.
The parameter adjustment scheme provided by the embodiment of the application is described in detail below through specific embodiments and application scenes thereof with reference to the accompanying drawings.
Referring to fig. 1, a flowchart illustrating steps of a text form conversion method according to an embodiment of the present application is shown, and as shown in fig. 1, the text form conversion method may specifically include the following steps:
step 101: building specification text in the form of text is obtained.
In the present application, the user may input a text form of building specification text to the electronic device, may input a text form of building specification text to the electronic device by means of image recognition and text recognition, or may input a text form of building specification text to the electronic device by means of other means, which is not limited in this embodiment of the present application.
Among them, building specification text is a list of requirement text issued by a country regarding building design specifications.
After obtaining the building specification text in literal 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 parsed through a semantic parser to obtain text in a slot-value expression form, namely, the attribute text.
The values may be normalized, for example, by normalizing the evacuation door and the safety exit to the evacuation door. The building specification text can be analyzed by adopting a context-free method model or a sequence labeling model and other related semantic analyzers, the embodiment of the application is not particularly limited, and specific adjustment and calibration can be performed according to actual application scenes.
By way of example, building specification text may include: when the building area of any floor of the residential building unit is greater than 650 square meters (m 2), or the distance from the door of any resident to the safety exit is greater than 15 meters, the leakage of each floor of the building unit should not be less than 2. The attribute text obtained after the semantic analysis processing 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 =ear_level } { construct. Element=fire_exit } { logic_function=not } { operation=lt } { value=2 }. Wherein,
{ residential. Type= RESIDENCE } represents [ residential building unit ];
{ STATEMENT =eal_level } represents [ any layer ];
{ construct. Element=flow_area } represents [ building AREA ];
{ operator=gt } represents [ greater than ];
{ value=650, unit=m2 } represents [ 650m2 ];
{ logic_function=or } represents [ OR ];
{ STATEMENT =eal_room } represents [ -any household ];
{ CONSTRATION. ELEMENT=DOOR } represents [ DOOR ];
{ CONSTREAINT. ELEMENT=FIRE_EXIT } represents [ safety EXIT ];
{ CONSTRATION = DISTANCE } represents [ DISTANCE ];
{ operator=gt } represents [ greater than ];
{ value=15, unit=m } represents [ 15 meters ];
{ STATEMENT =if_end } represents [ when ];
{ STATEMENT =eal_level } represents [ per layer ];
{ CONSTREAINT. ELEMENT=FIRE_EXIT } represents [ safety EXIT ];
{ logic_function=not } represents [ should NOT ];
{ operator=lt } means [ less than ];
{ value=2 } represents [ 2 ].
It will be appreciated that the above examples are only examples listed for better understanding of the technical solutions of the embodiments of the present application, and are not to be construed as the only limitation of the present embodiments.
A frame may consist of several structures called slots, each slot may be further divided into several sides according to actual needs, a slot may be used to describe an attribute of an aspect of an object, a side may be used to describe an aspect of a corresponding attribute, and the slot and the side have attribute values called slot value and side value, respectively.
After semantic parsing is performed on the building specification text to obtain an attribute text, step 103 is performed.
Step 103: and performing function mapping processing on the attribute text to obtain a calculation function.
In the present application, specific attribute texts may be mapped to the calculation functions according to a predefined dictionary, i.e. specific slot-values may be mapped to the calculation functions according to a predefined dictionary.
For example, { CONSTREAINT. RELATION=DISTANCE } can be expressed as [ DISTANCE ], mapped to a function DISTANCE (element 1, element2, unit), where element1 is the starting building element, element2 is the ending building element, and unit is the unit of return value.
After performing the function mapping process on the attribute text to obtain a calculation function, step 104 is performed.
Step 104: and carrying out language analysis processing on the attribute text based on the calculation function to obtain a target building specification text in a form language.
Wherein the target building specification text of the formal language is matched with the language form of the building information model.
In the application, language analysis processing can be performed on the attribute text based on the calculation function to obtain an abstract syntax tree; and carrying out reduction processing on the abstract syntax tree to obtain the target building specification text of the formal language.
Specifically, the attribute text may be parsed into an abstract syntax tree (Abstract Syntax Tree, AST) based on a calculation function, the parsing basis of which is predetermined to the formal language interpreter syntax, each value in the slot-value in each attribute text corresponds to a node on the AST, each slot defines the type of the node, wherein the acceptable type and number of sub-nodes of each node may be defined in advance according to actual needs. Expression parsing of an AST may be accomplished by a priority hill climbing (Precedence Climbing) algorithm, and program statement parsing of an AST may be accomplished by a recursive (Recursive descent) algorithm. And then carrying out reduction processing on AST to obtain the target building specification text in the form language.
Exemplary, building specification text may include: when the building area of any floor of the residential building unit is greater than 650 square meters (m 2), or the distance from the door of any resident to the safety exit is greater than 15 meters, the leakage of each floor of the building unit should not be less than 2, and the building unit is converted into:
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 computing objects in the formal language may not be unique, and the formal language parser may automatically develop formal language rules into computations for each possible object. Wherein, whether the calculation object is unique or not can be judged according to a predefined rule. For example, when level. Fire_exit and room. Door are not unique objects, then it will be translated into:
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。
according to the text form conversion method, building standard text in a text form is obtained; carrying out 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 in a form language; the electronic equipment can automatically convert the building standard text in a word form into the target building standard text in a form language which can be recognized by a computer, the situation that a worker inputs a building design standard in advance in a form language which can be processed by the computer into a computer system is avoided, the worker is required to have a certain computer programming basis and have professional building design knowledge, the problem of large task amount of the worker is solved, and the efficiency and reliability of automatically carrying out aesthetic drawing on the building design by the electronic equipment are improved.
Referring to fig. 2, a step flowchart of a text form conversion method provided in a second embodiment of the present application is shown, where the text form conversion method is applied to an electronic device, and as shown in fig. 2, the text form conversion method specifically may include the following steps:
step 201: building specification text in the form of text is obtained.
In the present application, the user may input a text form of building specification text to the electronic device, may input a text form of building specification text to the electronic device by means of image recognition and text recognition, or may input a text form of building specification text to the electronic device by means of other means, which is not limited in this embodiment of the present application.
Among them, building specification text is a list of requirement text issued by a country regarding building design specifications.
After the building specification text in literal form is obtained, 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 parsed through a semantic parser to obtain text in a slot-value expression form, namely, the attribute text.
The values may be normalized, for example, by normalizing the evacuation door and the safety exit to the evacuation door. The building specification text can be analyzed by adopting a context-free method model or a sequence labeling model and other related semantic analyzers, the embodiment of the application is not particularly limited, and specific adjustment and calibration can be performed according to actual application scenes.
By way of example, building specification text may include: when the building area of any floor of the residential building unit is greater than 650 square meters (m 2), or the distance from the door of any resident to the safety exit is greater than 15 meters, the leakage of each floor of the building unit should not be less than 2. The attribute text obtained after the semantic analysis processing 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 =ear_level } { construct. Element=fire_exit } { logic_function=not } { operation=lt } { value=2 }. Wherein,
{ residential. Type= RESIDENCE } represents [ residential building unit ];
{ STATEMENT =eal_level } represents [ any layer ];
{ construct. Element=flow_area } represents [ building AREA ];
{ operator=gt } represents [ greater than ];
{ value=650, unit=m2 } represents [ 650m2 ];
{ logic_function=or } represents [ OR ];
{ STATEMENT =eal_room } represents [ -any household ];
{ CONSTRATION. ELEMENT=DOOR } represents [ DOOR ];
{ CONSTREAINT. ELEMENT=FIRE_EXIT } represents [ safety EXIT ];
{ CONSTRATION = DISTANCE } represents [ DISTANCE ];
{ operator=gt } represents [ greater than ];
{ value=15, unit=m } represents [ 15 meters ];
{ STATEMENT =if_end } represents [ when ];
{ STATEMENT =eal_level } represents [ per layer ];
{ CONSTREAINT. ELEMENT=FIRE_EXIT } represents [ safety EXIT ];
{ logic_function=not } represents [ should NOT ];
{ operator=lt } means [ less than ];
{ value=2 } represents [ 2 ].
It will be appreciated that the above examples are only examples listed for better understanding of the technical solutions of the embodiments of the present application, and are not to be construed as the only limitation of the present embodiments.
A frame may consist of several structures called slots, each slot may be further divided into several sides according to actual needs, a slot may be used to describe an attribute of an aspect of an object, a side may be used to describe an aspect of a corresponding attribute, and the slot and the side have attribute values called slot value and side value, respectively.
After performing semantic parsing 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, specific attribute texts may be mapped to the calculation functions according to a predefined dictionary, i.e. specific slot-values may be mapped to the calculation functions according to a predefined dictionary.
For example, { CONSTREAINT. RELATION=DISTANCE } can be expressed as [ DISTANCE ], mapped to a function DISTANCE (element 1, element2, unit), where element1 is the starting building element, element2 is the ending building element, and unit is the unit of 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 in a form language.
Wherein the target building specification text of the formal language is matched with the language form of the building information model.
In the application, language analysis processing can be performed on the attribute text based on the calculation function to obtain an abstract syntax tree; and carrying out reduction processing on the abstract syntax tree to obtain the target building specification text of the formal language.
Specifically, the attribute text may be parsed into an abstract syntax tree (Abstract Syntax Tree, AST) based on a calculation function, the parsing basis of which is predetermined to the formal language interpreter syntax, each value in the slot-value in each attribute text corresponds to a node on the AST, each slot defines the type of the node, wherein the acceptable type and number of sub-nodes of each node may be defined in advance according to actual needs. Expression parsing of an AST may be accomplished by a priority hill climbing (Precedence Climbing) algorithm, and program statement parsing of an AST may be accomplished by a recursive (Recursive descent) algorithm. And then carrying out reduction processing on AST to obtain the target building specification text in the form language.
Exemplary, building specification text may include: when the building area of any floor of the residential building unit is greater than 650 square meters (m 2), or the distance from the door of any resident to the safety exit is greater than 15 meters, the leakage of each floor of the building unit should not be less than 2, and the building unit is converted into:
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 computing objects in the formal language may not be unique, and the formal language parser may automatically develop formal language rules into computations for each possible object. Wherein, whether the calculation object is unique or not can be judged according to a predefined rule. For example, when level. Fire_exit and room. Door are not unique objects, then it will be translated into:
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 performed when the language parsing process is performed on the attribute text based on the calculation function, so as to obtain the target building specification text of the formal language.
Step 205: under the condition that the latest building standard text is received and the latest target building standard text of the formal language is obtained, the 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 is obtained.
Since the building specification text duration is updated, in the case of receiving the latest building specification text, the latest target building specification text of the formal language can be obtained according to steps 201-204, and then whether the output results of the previous target building specification text and the latest target building specification text are the same or not is checked for the same input, and if different results appear, the target updated building specification sub-text with different results is determined.
In the case that the latest building specification text is received and the latest target building specification text of the formal language is obtained, after obtaining the target updated building specification sub-text corresponding to the same input, the output results of the latest target building specification text and the target building specification text are different, step 206 is performed.
Step 206: updating the target updated building specification sub-text based on the latest target building specification text to obtain an updated target updated building specification text.
Because the building specification text duration is updated, in the case that the latest building specification text is received, the latest target building specification text of the formal language can be obtained according to steps 201-204, whether the output results of the previous target building specification text and the latest target building specification text are the same or not is checked, if the output results are different, 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 workload of staff is large due to frequent updating of building design specifications can be avoided, the workload of staff is reduced, and the efficiency and reliability of automatic drawing inspection of building design by a machine are improved.
It should be noted that, for a formal language code generated by a specification, to ensure that a combination of different attributes is effectively constructed to verify each logical branch of the formal language code, in this application, test cases may be automatically generated based on a software test (Search Based Software Testing, SBST) method of searching. The specific algorithm may include a hill climbing algorithm, a simulated annealing algorithm, a genetic algorithm and the like, which is not limited in the embodiment of the application, and may be calibrated and adjusted according to an actual application scenario.
According to the text form conversion method, building standard text in a text form is obtained; carrying out 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 in a form language; the electronic equipment can automatically convert the building standard text in a word form into the target building standard text in a form language which can be recognized by a computer, the situation that a worker inputs a building design standard in advance in a form language which can be processed by the computer into a computer system is avoided, the worker is required to have a certain computer programming basis and have professional building design knowledge, the problem of large task amount of the worker is solved, and the efficiency and reliability of automatically carrying out aesthetic drawing on 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 body may be a text form conversion device, or a control module in the text form conversion device for executing the loading text form conversion method. In the embodiment of the present application, the text form conversion device executes the loaded text form conversion method as an example, and the text form conversion method provided in the embodiment of the present application is described.
Referring to fig. 3, a schematic structural diagram of a text form conversion device provided in a third embodiment of the present application is shown, where the text form conversion device may be applied to an electronic device, and as shown in fig. 3, the text form conversion device may specifically include the following modules:
the building code text acquisition module 301 is configured to acquire a building code 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;
the function mapping module 303 is configured to perform a function mapping process on the attribute text to obtain a calculation function;
the second parsing module 304 is configured to perform language parsing processing on the attribute text based on the calculation function, so as to obtain a target building specification text in a formal language;
wherein the target building specification text of the formal language is matched with the language form of the building information model.
Optionally, the apparatus further comprises:
the sub-text acquisition module is used for acquiring target updated building specification sub-texts corresponding to the same input under the condition that the latest building specification text is received and the latest target building specification text of a formal language is obtained, wherein the output results of the latest target building specification text and the target building specification text are different;
and the updating module is used for updating the target updated building specification sub-text based on the latest target building specification text to obtain an updated target updated 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 sub-module is used for carrying out reduction processing on the abstract syntax tree to obtain the target building specification text of the formal language.
According to the text form conversion device, building standard texts in a text form are obtained; carrying out 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 in a form language; the electronic equipment can automatically convert the building standard text in a word form into the target building standard text in a form language which can be recognized by a computer, the situation that a worker inputs a building design standard in advance in a form language which can be processed by the computer into a computer system is avoided, the worker is required to have a certain computer programming basis and have professional building design knowledge, the problem of large task amount of the worker is solved, and the efficiency and reliability of automatically carrying out aesthetic drawing on the building design by the electronic equipment are improved.
The text form conversion device in the embodiment of the application may be a device, or may be a component, an integrated circuit, or a chip in a terminal. The device may be a mobile electronic device or a non-mobile electronic device. By way of example, the mobile electronic device may be a cell phone, tablet computer, notebook computer, palm computer, vehicle-mounted electronic device, wearable device, ultra-mobile personal computer (ultra-mobile personal computer, UMPC), netbook or personal digital assistant (personal digital assistant, PDA), etc., and the non-mobile electronic device may be a server, network attached storage (Network Attached Storage, NAS), personal computer (personal computer, PC), television (TV), teller machine or self-service machine, etc., and the embodiments of the present application are not limited in particular.
The text form conversion device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an ios operating system, or other possible operating systems, which are not specifically limited in the embodiments of the present application.
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 3, and in order to avoid repetition, a description is omitted here.
Based on the same inventive concept, another embodiment of the present application provides a readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method for text form conversion according to any of the embodiments of the present application.
Based on the same inventive concept, another embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor executes the steps in the method for converting text forms described in any of the foregoing embodiments of the present application.
For the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points.
In this specification, each embodiment is described in a progressive or illustrative manner, and each embodiment is mainly described by the differences from other embodiments, and identical and similar parts between the embodiments are mutually referred.
It will be apparent to those skilled in the art that embodiments of the present application may be provided as a method, apparatus, or computer program product. Accordingly, the present embodiments 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 on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) 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 flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations 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 device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, 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 apparatus 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 apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus 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 embodiments have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the present application.
Finally, it is further noted that relational terms such as first and second, and the like are 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. Moreover, 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 one … …" does not exclude the presence of other like elements in a process, method, article or terminal device comprising the element.
The above description of the text form conversion method, system, device and storage medium provided in the present application is provided in detail, and the description of the above embodiments is only for helping to understand the method and core idea of the present application; meanwhile, as those skilled in the art will have modifications in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.
Claims (8)
1. A text form conversion method, comprising:
acquiring building standard texts in a text form;
carrying out 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 in a form language;
wherein, the target building specification text of the formal language is matched with the language form of the building information model;
the semantic analysis processing is carried out on the building specification text to obtain an attribute text, which comprises the following steps:
carrying out semantic analysis processing on the building specification text to obtain an attribute text in a slot value expression form;
the value is normalized, and the evacuation door and the safety exit are normalized to be the evacuation door; analyzing the building specification text by adopting a semantic analyzer such as a context-free method model or a sequence labeling model;
performing function mapping processing on the attribute text to obtain the calculation function, including:
mapping a specific slot value into the calculation function according to a predefined dictionary.
2. The method according to claim 1, further comprising, after said subjecting said attribute text to a language parsing process based on said calculation function to obtain a target building specification text in a formal language:
under the condition that the latest building standard text is received and the latest target building standard text of the formal language is obtained, acquiring target updated building standard sub-texts which correspond to the same input and have different output results from the latest target building standard text and the target building standard text;
updating the target updated building specification sub-text based on the latest target building specification text to obtain an updated target updated building specification text.
3. The method according to claim 1, wherein the language parsing process is performed on the attribute text based on the computing function to obtain a target building specification text in a formal language, including:
performing language analysis processing on the attribute text based on the calculation function to obtain an abstract syntax tree;
and carrying out reduction processing on the abstract syntax tree to obtain the target building specification text of the formal language.
4. A text form conversion device, comprising:
the building standard text acquisition module is used for acquiring building standard texts in a text 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 performing function mapping processing on the attribute text to obtain a calculation function; comprising the following steps: mapping a specific slot value into the computing function according to a predefined dictionary;
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 specification text in a form language;
wherein, the target building specification text of the formal language is matched with the language form of the building information model;
the first parsing module includes:
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; the value is normalized, and the evacuation door and the safety exit are normalized to be the evacuation door; and analyzing the building specification text by adopting a semantic analyzer such as a context-free method model or a sequence labeling model.
5. The apparatus of claim 4, wherein the apparatus further comprises:
the sub-text acquisition module is used for acquiring target updated building specification sub-texts corresponding to the same input under the condition that the latest building specification text is received and the latest target building specification text of a formal language is obtained, wherein the output results of the latest target building specification text and the target building specification text are different;
and the updating module is used for updating the target updated building specification sub-text based on the latest target building specification text to obtain an updated target updated building specification text.
6. The apparatus of claim 4, 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 sub-module is used for carrying out reduction processing on the abstract syntax tree to obtain the target building specification text of the formal language.
7. An electronic device comprising a processor, a memory and a program or instruction stored on the memory and executable on the processor, which when executed by the processor implements the text form conversion method of any one of claims 1 to 3.
8. A readable storage medium, characterized in that a program or instructions is stored on the readable storage medium, which when executed by a processor implements the text form conversion method of any one of claims 1 to 3.
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 CN113312880A (en) | 2021-08-27 |
CN113312880B true 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 (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
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 |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5536518B2 (en) * | 2009-04-23 | 2014-07-02 | インターナショナル・ビジネス・マシーンズ・コーポレーション | Method, apparatus and computer for automatically extracting a system modeling metamodel language model for the system from the natural language specification of the system |
-
2021
- 2021-04-02 CN CN202110362881.1A patent/CN113312880B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
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 |
---|---|
CN113312880A (en) | 2021-08-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11487539B2 (en) | Systems and methods for automating and monitoring software development operations | |
US11327874B1 (en) | System, method, and computer program for orchestrating automatic software testing | |
US9122540B2 (en) | Transformation of computer programs and eliminating errors | |
US20170357927A1 (en) | Process management for documentation-driven solution development and automated testing | |
EP4322009A1 (en) | Test case generation method, apparatus and device | |
CN109739494B (en) | Tree-LSTM-based API (application program interface) use code generation type recommendation method | |
CN108255837B (en) | SQL parser and method | |
CN113504900A (en) | Programming language conversion method and device | |
CN117113347A (en) | Large-scale code data feature extraction method and system | |
CN113821496B (en) | Database migration method, system, device and computer readable storage medium | |
CN113688134B (en) | Visual variable management method, system and equipment based on multidimensional data | |
CN114647590A (en) | Test case generation method and related device | |
CN113312880B (en) | Text form conversion method and device and electronic equipment | |
CN117420985A (en) | Method for packaging android service function by using JavaScript | |
CN117348854A (en) | Method and device for generating control flow of Internet of things based on natural language dialogue | |
CN110716859A (en) | Method for automatically pushing test cases for modified codes and related device | |
CN116069324A (en) | Dynamic form construction method and device based on Vue | |
CN113807077B (en) | Natural language test script analysis processing method and device and electronic equipment | |
CN111151008B (en) | Verification method and device for game operation data, configuration background and medium | |
CN115292178A (en) | Test data searching method, device, storage medium and terminal | |
CN114610648A (en) | Test method, device and equipment | |
CN114153447A (en) | Method for automatically generating AI training code | |
CN109597638B (en) | Method and device for solving data processing and equipment linkage based on real-time computing engine | |
CN112882937A (en) | Test case processing method and device, computer equipment and storage medium | |
CN112162738B (en) | Data conversion method and device, terminal equipment and storage 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 |