Disclosure of Invention
Embodiments of the present invention provide a method, an apparatus, a terminal, and a computer-readable storage medium for area identification, so as to solve one or more technical problems in the prior art.
In a first aspect, an embodiment of the present invention provides a method for area identification, including:
extracting query semantic information from the query statement;
searching a plurality of key value pairs relevant to the query semantic information in a key value library;
acquiring auxiliary information related to the query semantic information;
weighting the auxiliary information and each searched key value pair to obtain reply semantic information;
converting the reply semantic information into a reply sentence.
With reference to the first aspect, in a first implementation manner of the first aspect, the searching for the multiple key-value pairs related to the query semantic information in the key-value library includes:
extracting knowledge semantic information from the query semantic information;
acquiring knowledge linguistic data related to the knowledge semantic information from a knowledge base;
and forming the key value pair by the knowledge semantic information and the knowledge corpus.
With reference to the first implementation manner of the first aspect, in a second implementation manner of the first aspect, the forming the key-value pair by the knowledge semantic information and the knowledge corpus includes:
and forming the key value pairs by the knowledge semantic information and the knowledge corpus through a neural network.
With reference to the first aspect, in a third implementation manner of the first aspect, the embodiment of the present invention further includes:
forming question-answer key value pairs by the answer semantic information and the query semantic information;
matching the question-answer key value pair with the existing key value pair stored in the key value library, and if the question-answer key value pair does not exist in the existing key value pair of the key value library, storing the question-answer key value pair into the key value library.
With reference to the third implementation manner of the embodiment in the first aspect, in a fourth implementation manner of the first aspect, the embodiment of the present invention matches the question-answer key value pair with an existing key value pair stored in the key value library, and stores the question-answer key value pair into the key value library if the question-answer key value pair does not exist in the existing key value pair of the key value library, and the specific steps include:
temporarily storing the question-answer key value pairs into a short-term memory area of the key value library;
and evaluating the question-answer key value pair through an evaluation model, and if the threshold value of the question-answer key value pair exceeds the threshold value of the existing key value pair, storing the question-answer key value pair into a long-term memory area of the key value library.
With reference to the first aspect, in a fifth implementation manner of the first aspect, the embodiment of the present invention further includes:
and adjusting the language expression mode of the reply sentence through a random variable.
In a second aspect, an embodiment of the present invention provides an apparatus for area identification, including:
the extraction module is used for extracting query semantic information from the query statement;
the acquisition module is used for searching a plurality of key value pairs relevant to the query semantic information in a key value library;
the auxiliary information module is used for acquiring auxiliary information related to the query semantic information;
the processing module is used for weighting the auxiliary information and each searched key value pair to obtain reply semantic information;
and the conversion module is used for converting the reply semantic information into a reply sentence.
In one possible design, the obtaining module includes:
the extraction submodule is used for extracting knowledge semantic information from the query semantic information;
the acquisition submodule is used for acquiring knowledge linguistic data related to the knowledge semantic information from a knowledge base;
and the key value pair sub-module is used for constructing the knowledge semantic information and the knowledge corpus into the key value pair.
In one possible design, further comprising:
the matching module is used for forming question-answer key value pairs by the reply semantic information and the query semantic information;
and the expansion module is used for matching the question-answer key value pair with the existing key value pair stored in the key value library, and storing the question-answer key value pair into the key value library when the question-answer key value pair does not exist in the existing key value pair of the key value library.
In one possible design, the expansion module includes:
the short memory submodule is used for temporarily storing the question-answer key value pair into a short-term memory area of the key value library;
and the long memory sub-module is used for evaluating the question-answer key value pair through an evaluation model, and storing the question-answer key value pair into a long-term memory area of the key value library if the threshold value of the question-answer key value pair exceeds the threshold value of the existing key value pair.
In a third aspect, an embodiment of the present invention provides a terminal for area identification, including:
the functions of the terminal can be realized by hardware, and can also be realized by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the above-described functions.
In one possible design, the structure of the terminal for area identification includes a processor and a memory, the memory is used for storing a program for enabling the terminal for area identification to execute the method for area identification in the first aspect, and the processor is configured to execute the program stored in the memory. The zone identification terminal may further comprise a communication interface for the zone identification terminal to communicate with other devices or a communication network.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium for storing computer software instructions for a terminal for area identification, which includes a program for executing the method for area identification in the first aspect to the terminal for area identification.
One of the above technical solutions has the following advantages or beneficial effects: the region type and the boundary of the specified region can be identified according to the real-time road network data and the dotting data, so that the timeliness and the accuracy of the region type and the boundary identified in the current time period can be guaranteed.
The foregoing summary is provided for the purpose of description only and is not intended to be limiting in any way. In addition to the illustrative aspects, embodiments, and features described above, further aspects, embodiments, and features of the present invention will be readily apparent by reference to the drawings and following detailed description.
Detailed Description
In the following, only certain exemplary embodiments are briefly described. As those skilled in the art will recognize, the described embodiments may be modified in various different ways, all without departing from the spirit or scope of the present invention. Accordingly, the drawings and description are to be regarded as illustrative in nature, and not as restrictive.
The embodiment of the invention provides a method for identifying a region, in particular a method for identifying a type and a boundary of a region, as shown in fig. 1, which comprises the following steps:
s100: the designated area is divided into a plurality of blocks according to the road network data. The designated area may include, but is not limited to, a city, county, cell, or natural geographic region of large area, etc.
S200: and screening dotting data of the designated area according to the area type to be identified. The area types may include, but are not limited to, residential areas (residential), commercial areas, industrial areas, administrative areas, and the like. The dotting data are GPS points positioned under the line, and according to different data types, the same area can contain a plurality of types of dotting data.
S300: and clustering the screened dotting data.
S400: and acquiring a target area corresponding to the area type from the plurality of blocks according to the clustering result.
S500: and identifying the boundary of the target area according to the screened dotting data. A boundary may be understood as a geographical boundary or footprint of the area.
In one embodiment, the partitioning of the designated area into a plurality of blocks based on road network data comprises: a plurality of split roads are determined from the road network data of the specified region. And performing line segment aggregation on each segmented road, and segmenting the designated area into a plurality of blocks. Furthermore, for more accurate segmentation, relevant area data of the specified region can be introduced, and the specified region is segmented into a plurality of blocks by combining the relevant area data of the specified region with the road network data.
It should be noted that the road network data may include, but is not limited to, various data such as types, grades, names, and speed limits of roads. For example, the types of roads include expressways, ordinary roads, shaded roads, public roads, private roads, and the like. The road grade includes motor vehicle main roads, motor vehicle auxiliary roads, sidewalks, bicycle roads and the like. The road speed limit comprises a starting section speed limit, a terminating section speed limit and the like.
In a specific embodiment, the road may be divided according to a predetermined rule. For example, the rule is set that the road is a public road, the initial speed limit of the road is not lower than 30km/h, and the road in the designated area is screened according to the rule. If the cut blocks are staggered with the common boundary of the original designated area, the boundary of the blocks cut according to the cut road is taken as the standard.
In one embodiment, clustering the screened dotting data comprises: and clustering the screened dotting data through a density clustering algorithm, and generating a clustering result.
In a specific embodiment, if the area to be identified is a residential area, people group dotting data related to the residential area can be screened from the dotting data of the designated area. For example, the dotting data of the night resident positions of the crowd and/or the dotting data of the family resident positions of the crowd are used as clustering features, clustering is carried out through a density clustering algorithm to mine the clustering areas, and then the blocks belonging to the type of the residential area are identified. The cluster feature may only include one type of dotting data related to the residential area type, or may include a plurality of types of dotting data related to the residential area type.
Similarly, if the area type to be identified is a business area, an administrative area or an industrial area, the dotting data related to the designated area type is screened from the dotting data of the designated area. The specific screened data can be selected according to the need, and the specific identification manner refers to the above embodiments, which are not illustrated herein.
In one embodiment, points of interest may also be introduced in order to enable further analysis of the screened type blocks. As shown in fig. 2, the method may further include:
step S600: and screening the interest points of the designated area according to the area type to be identified.
Step S700: and carrying out relationship judgment and distance calculation on the screened interest points and the target area to obtain the interest points associated with the target area.
Step S800: and acquiring the area information of the target area according to the associated interest points.
The points of interest may include any information and data about where the target area is located. For example, when the type of the area to be identified is a residential area, the filtered points of interest may include any area information related to the residential area, such as a cell name, a street name, an area of the cell, a population, a type of the residential population, and the like.
In a specific embodiment, the performing relationship judgment and distance calculation on the screened interest points and the target area to obtain the interest points associated with the target area includes:
and if one interest point is positioned in the boundary of the target area, determining the associated interest point.
If one interest point is located around the boundary of the target area, calculating the distance between the interest point and the boundary of the area, and if the distance is within the threshold range, determining the associated interest point.
If one interest point is located in a plurality of target areas, the target area with the closest distance is selected as the associated interest point.
For example, after a plurality of blocks with types of residential areas are screened out, the area information such as specific cell names, cell areas, and type distribution of resident people of each residential area can be further judged according to the interest points.
In one embodiment, the region identification method further comprises: and integrating the identified blocks, block boundaries and area information to form complete associated data.
An embodiment of the present invention provides an area identification apparatus, as shown in fig. 3, including:
and adividing module 10, configured to divide the designated area into a plurality of blocks according to the road network data.
Thefirst screening module 20 is configured to screen dotting data of a specified area according to an area type that needs to be identified.
And the clustering module 30 is used for clustering the screened dotting data.
And the regiontype identification module 40 is configured to obtain a target region corresponding to a region type from the plurality of blocks according to the clustering result.
And the areaboundary identification module 50 is used for identifying the boundary of the target area according to the screened dotting data.
In one embodiment, the slittingmodule 10 comprises:
and the road selection submodule is used for determining a plurality of split roads from the road network data of the specified region.
And the segmentation submodule is used for carrying out line segment aggregation on each segmented road and segmenting the designated area into a plurality of blocks.
In one embodiment, as shown in fig. 3, the apparatus for area identification further includes:
and a second screening module 60, configured to screen the interest points in the designated area according to the area type.
And theprocessing module 70 is configured to perform relationship judgment and distance calculation on the screened interest points and the target area to obtain interest points associated with the target area.
In one embodiment, theprocessing module 70 includes:
and the judgment submodule is used for judging that if one interest point is positioned in the boundary of the target area, the interest point is judged to be associated. If one interest point is located around the boundary of the target area, calculating the distance between the interest point and the boundary of the area, and if the distance is within the threshold range, determining the associated interest point.
In one embodiment, a data output module 80 is further included for integrating the identified blocks, block boundaries and region information to form complete associated data.
An embodiment of the present invention provides a terminal for area identification, as shown in fig. 4, including:
amemory 910 and aprocessor 920, thememory 910 having stored therein computer programs operable on theprocessor 920. Theprocessor 920 implements the methods of the target area type and boundary in the above embodiments when executing the computer program. The number of thememory 910 and theprocessor 920 may be one or more.
Acommunication interface 930 for thememory 910 and theprocessor 920 to communicate with the outside.
Memory 910 may include high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
If thememory 910, theprocessor 920 and thecommunication interface 930 are implemented independently, thememory 910, theprocessor 920 and thecommunication interface 930 may be connected to each other through a bus and perform communication with each other. The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 4, but this does not indicate only one bus or one type of bus.
Optionally, in an implementation, if thememory 910, theprocessor 920 and thecommunication interface 930 are integrated on a chip, thememory 910, theprocessor 920 and thecommunication interface 930 may complete communication with each other through an internal interface.
The embodiment of the invention provides a computer readable storage medium, which stores a computer program, and the program is executed by a processor to implement the region identification method according to any one of the embodiments.
According to the embodiment of the invention, the region type and the boundary of the designated region can be identified according to the real-time road network data and the dotting data, so that the timeliness and the accuracy of the region type and the boundary identified in the current time period can be ensured. On the basis, by associating with the interest points, more business analysis can be performed on the area on the basis of the identified type area, and the application range is wide. For example, the method is applied to various different requirements such as big data marketing, site selection, sales forecast and the like.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the feature. In the description of the present invention, "a plurality" means two or more unless specifically defined otherwise.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps in the process, and alternate implementations are included within the scope of the preferred embodiment of the present invention in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present invention.
The logic and/or steps represented in the flowcharts or otherwise described herein, such as an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution apparatus, device, or device (e.g., a computer-based apparatus, processor-containing apparatus, or other device that can fetch the instructions from the instruction execution apparatus, device, or device and execute the instructions). For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution apparatus, device, or apparatus. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by suitable instruction execution devices. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried out in the method of implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and the program, when executed, includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a separate product, may also be stored in a computer readable storage medium. The storage medium may be a read-only memory, a magnetic or optical disk, or the like.
The above description is only for the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive various changes or substitutions within the technical scope of the present invention, and these should be covered by the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.