CN109933681A - Image searching method, device and computer readable storage medium - Google Patents
Image searching method, device and computer readable storage medium Download PDFInfo
- Publication number
- CN109933681A CN109933681A CN201910210621.5A CN201910210621A CN109933681A CN 109933681 A CN109933681 A CN 109933681A CN 201910210621 A CN201910210621 A CN 201910210621A CN 109933681 A CN109933681 A CN 109933681A
- Authority
- CN
- China
- Prior art keywords
- keyword
- text information
- keywords
- picture
- pictures
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
技术领域technical field
本发明涉及图片处理领域,尤其涉及一种图片搜索方法、装置和计算机可读存储介质。The present invention relates to the field of picture processing, and in particular, to a picture search method, device and computer-readable storage medium.
背景技术Background technique
随着科技的发展,知识的教学方式越来越多样,从以往的纯文本信息到后来的视频信息,都极大的丰富着人们的教学方式和教学体验。尤其在很多的文本信息教学中,在文本中配有插图,能更鲜活,直接的展示文本中的信息,吸引读者的注意,同时具有形象性和直观性的特点。With the development of science and technology, the teaching methods of knowledge are more and more diverse, from the past plain text information to the later video information, which greatly enrich people's teaching methods and teaching experience. Especially in many text information teaching, the text is equipped with illustrations, which can more vividly and directly display the information in the text, attract the attention of readers, and have the characteristics of image and intuition.
但是目前,文本信息中的插图多是通过人工基于对文本理解的基础上,手动搜索图片添加进去的,该方法不仅需要人工的脑力劳动,还需要耗费较长的时间。However, at present, the illustrations in the text information are mostly added by manually searching for pictures based on the understanding of the text. This method not only requires manual mental work, but also takes a long time.
发明内容SUMMARY OF THE INVENTION
本发明的主要目的在于提供一种图片搜索方法、装置和计算机可读存储介质,旨在实现在获得文本资料后,对文本资料进行划分提取获得关键词,并根据关键词自动搜索相关的图片。The main purpose of the present invention is to provide a picture search method, device and computer-readable storage medium, aiming to realize that after obtaining text data, the text data is divided and extracted to obtain keywords, and related pictures are automatically searched according to the keywords.
为实现上述目的,本发明提供一种图片搜索方法,所述图片搜索方法包括以下步骤:In order to achieve the above object, the present invention provides a picture search method, and the picture search method includes the following steps:
获得文本信息;get text information;
对所述文本信息进行关键词提取,获得所述文本信息的关键词;Perform keyword extraction on the text information to obtain keywords of the text information;
根据所述关键词在预置的图库中进行检索,获得与所述关键词对应的图片。Search in a preset gallery according to the keyword to obtain a picture corresponding to the keyword.
可选地,所述对所述文本信息进行关键词提取,获得所述文本信息的关键词的步骤包括:Optionally, the step of performing keyword extraction on the text information to obtain keywords of the text information includes:
对所述文本信息进行词类划分,划分为多个词类词语;Partitioning the text information into multiple parts of speech words;
对所述多个词类词语进行筛选,选择预设词类的词为关键词。Screening the words of the multiple parts of speech, and selecting the words of the preset part of speech as keywords.
可选地,所述根据所述关键词在预置的图库中进行检索,获得与所述关键词对应的图片的步骤包括:Optionally, the step of performing retrieval in a preset gallery according to the keyword, and obtaining a picture corresponding to the keyword includes:
根据各关键词对应的词类确定所述关键词的优先级,根据确定的优先级对所述关键词进行排序;Determine the priority of the keywords according to the part of speech corresponding to each keyword, and sort the keywords according to the determined priorities;
根据排序结果依次在数据库中进行检索,得到所述关键词对应的图片。According to the sorting results, the database is searched in sequence to obtain the pictures corresponding to the keywords.
可选地,所述关键词中各词语的优先级从高到低依次为名词、动词和形容词。Optionally, the priority of each word in the keyword is a noun, a verb, and an adjective in descending order.
可选地,所述根据各关键词对应的词类确定所述关键词的优先级的步骤包括:Optionally, the step of determining the priority of the keyword according to the part of speech corresponding to each keyword includes:
确定所述动词和形容词对应于名词的位置,根据所述动词和形容词对应于名词的位置确定所述动词和形容词的优先级。The positions of the verbs and adjectives corresponding to the nouns are determined, and the priority of the verbs and adjectives is determined according to the positions of the verbs and adjectives corresponding to the nouns.
可选地,所述根据排序结果依次在数据库中进行检索,得到所述关键词对应的图片的步骤包括:Optionally, the step of sequentially retrieving in the database according to the sorting results, and obtaining the pictures corresponding to the keywords includes:
根据所述关键词中优先级别最高的关键词在数据库中进行检索,获得对应的第一大类图片;Search in the database according to the keyword with the highest priority among the keywords, and obtain the corresponding first category of pictures;
在所述第一大类图片中根据各关键词的优先顺序依次进行检索,获得对应的图片。The first category of pictures is searched in sequence according to the priority order of each keyword to obtain corresponding pictures.
可选地,所述优先级别最高的关键词包括多个时,所述根据所述关键词中优先级别最高的关键词在数据库中进行检索,获得对应的第一大类图片的步骤包括:Optionally, when there are multiple keywords with the highest priority, the step of performing retrieval in the database according to the keyword with the highest priority among the keywords, and obtaining the corresponding first category of pictures includes:
分别以优先级别最高的词类中的每个关键词进行检索,获得对应的多个第一大类图片。Respectively search for each keyword in the word class with the highest priority, and obtain a plurality of corresponding first-class pictures.
可选地,所述获得文本信息的步骤还包括:Optionally, the step of obtaining text information further includes:
获得语音信息;get voice information;
将所述语音信息进行文字转换,转化为文本信息。The voice information is converted into text information by text conversion.
此外,为实现上述目的,本发明还提供一种图片搜索装置,所述图片搜索装置包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的图片搜索程序,所述图片搜索程序被所述处理器执行时实现如上所述的图片搜索方法的步骤。In addition, in order to achieve the above object, the present invention also provides a picture search device, the picture search device includes: a memory, a processor and a picture search program stored in the memory and running on the processor, When the picture search program is executed by the processor, the steps of the picture search method as described above are realized.
此外,为实现上述目的,本发明还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有图片搜索程序,所述图片搜索程序被处理器执行时实现上述的图片搜索方法的步骤。In addition, in order to achieve the above object, the present invention also provides a computer-readable storage medium, where a picture search program is stored on the computer-readable storage medium, and when the picture search program is executed by a processor, the above-mentioned picture search method is realized. step.
本发明提供一种图片搜索方法、装置和计算机存储介质。在该方法中,获得文本信息;对所述文本信息进行关键词提取,获得所述文本信息的关键词;根据所述关键词在预置的图库中进行检索,获得与所述关键词对应的图片。通过上述方式,本发明能够实现根据获得的文本资料自动搜索相关的图片,使搜索到的图片能够插入文本信息中作为文本插图进行展示,进而使文本资料更加生动形象,丰富文本信息的表现形式,更加有益于读者,特别是小朋友进行阅读理解。The present invention provides a picture search method, device and computer storage medium. In this method, text information is obtained; keyword extraction is performed on the text information to obtain the keywords of the text information; according to the keywords, a preset gallery is searched to obtain the corresponding keywords. picture. Through the above method, the present invention can automatically search for relevant pictures according to the obtained text data, so that the searched pictures can be inserted into the text information and displayed as text illustrations, thereby making the text data more vivid and enriching the expression form of the text information, It is more beneficial to readers, especially children's reading comprehension.
附图说明Description of drawings
图1是本发明实施例方案涉及的硬件运行环境的装置结构示意图;1 is a schematic diagram of a device structure of a hardware operating environment involved in an embodiment of the present invention;
图2为本发明图片搜索方法第一实施例的流程示意图;2 is a schematic flowchart of a first embodiment of a picture search method according to the present invention;
图3为本发明图片搜索方法第二实施例的流程示意图;3 is a schematic flowchart of a second embodiment of a picture search method according to the present invention;
图4为本发明图片搜索方法第三实施例的流程示意图;4 is a schematic flowchart of a third embodiment of a picture search method according to the present invention;
图5为本发明图片搜索方法第四实施例的流程示意图;5 is a schematic flowchart of a fourth embodiment of a picture search method according to the present invention;
图6为本发明图片搜索方法第五实施例的流程示意图;6 is a schematic flowchart of a fifth embodiment of a picture search method according to the present invention;
本发明目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization, functional characteristics and advantages of the present invention will be further described with reference to the accompanying drawings in conjunction with the embodiments.
具体实施方式Detailed ways
应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。It should be understood that the specific embodiments described herein are only used to explain the present invention, but not to limit the present invention.
如图1所示,图1是本发明实施例方案涉及的硬件运行环境的装置结构示意图。As shown in FIG. 1 , FIG. 1 is a schematic diagram of a device structure of a hardware operating environment involved in the solution of an embodiment of the present invention.
本发明实施例终端可以是PC,也可以是智能手机、平板电脑、便携计算机等具有数据处理功能的终端设备。The terminal in the embodiment of the present invention may be a PC, or may be a terminal device with a data processing function, such as a smart phone, a tablet computer, and a portable computer.
如图1所示,该终端可以包括:处理器1001,例如CPU,网络接口1004,用户接口1003,存储器1005,通信总线1002。其中,通信总线1002用于实现这些组件之间的连接通信。用户接口1003可以包括显示屏(Display)、输入单元比如键盘(Keyboard),可选用户接口1003还可以包括标准的有线接口、无线接口。网络接口1004可选的可以包括标准的有线接口、无线接口(如WI-FI接口)。存储器1005可以是高速RAM存储器,也可以是稳定的存储器(non-volatile memory),例如磁盘存储器。存储器1005可选的还可以是独立于前述处理器1001的存储装置。As shown in FIG. 1 , the terminal may include: a processor 1001 , such as a CPU, a network interface 1004 , a user interface 1003 , a memory 1005 , and a communication bus 1002 . Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. Optionally, the network interface 1004 may include a standard wired interface and a wireless interface (eg, a WI-FI interface). The memory 1005 may be high-speed RAM memory, or may be non-volatile memory, such as disk memory. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001 .
可选地,终端还可以包括摄像头、RF(Radio Frequency,射频)电路,传感器、音频电路、Wi-Fi模块等等。其中,传感器比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示屏的亮度,接近传感器可在移动终端移动到耳边时,关闭显示屏和/或背光。作为运动传感器的一种,重力加速度传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别移动终端姿态的应用(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;当然,移动终端还可配置陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器,在此不再赘述。Optionally, the terminal may further include a camera, an RF (Radio Frequency, radio frequency) circuit, a sensor, an audio circuit, a Wi-Fi module, and the like. Among them, sensors such as light sensors, motion sensors and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display screen according to the brightness of the ambient light, and the proximity sensor may turn off the display screen and/or turn off the display screen when the mobile terminal is moved to the ear. Backlight. As a kind of motion sensor, the gravitational acceleration sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary, and can be used for applications that recognize the posture of mobile terminals (such as horizontal and vertical screen switching, related games, magnetometer attitude calibration), vibration recognition related functions (such as pedometer, tapping), etc.; of course, the mobile terminal can also be equipped with other sensors such as gyroscope, barometer, hygrometer, thermometer, infrared sensor, etc. No longer.
本领域技术人员可以理解,图1中示出的终端结构并不构成对终端的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。Those skilled in the art can understand that the terminal structure shown in FIG. 1 does not constitute a limitation on the terminal, and may include more or less components than the one shown, or combine some components, or arrange different components.
如图1所示,作为一种计算机存储介质的存储器1005中可以包括操作系统、网络通信模块、用户接口模块以及图片搜索程序。As shown in FIG. 1 , the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module and a picture search program.
在图1所示的终端中,网络接口1004主要用于连接后台服务器,与后台服务器进行数据通信;用户接口1003主要用于连接客户端(用户端),与客户端进行数据通信;而处理器1001可以用于调用存储器1005中存储的图片搜索程序,并执行以下操作:In the terminal shown in FIG. 1 , the network interface 1004 is mainly used to connect to the background server and perform data communication with the background server; the user interface 1003 is mainly used to connect to the client (client) and perform data communication with the client; and the processor 1001 can be used to invoke the picture search program stored in memory 1005 and perform the following operations:
获得文本信息;get text information;
对所述文本信息进行关键词提取,获得所述文本信息的关键词;Perform keyword extraction on the text information to obtain keywords of the text information;
根据所述关键词在预置的图库中进行检索,获得与所述关键词对应的图片。Search in a preset gallery according to the keyword to obtain a picture corresponding to the keyword.
进一步地,处理器1001可以调用存储器1005中存储的图片搜索程序,还执行以下操作:Further, the processor 1001 can call the picture search program stored in the memory 1005, and also perform the following operations:
对所述文本信息进行词类划分,划分为多个词类词语;Partitioning the text information into multiple parts of speech words;
对所述多个词类词语进行筛选,选择预设词类的词为关键词。Screening the words of the multiple parts of speech, and selecting the words of the preset part of speech as keywords.
进一步地,处理器1001可以调用存储器1005中存储的图片搜索程序,还执行以下操作:Further, the processor 1001 can call the picture search program stored in the memory 1005, and also perform the following operations:
根据各关键词对应的词类确定所述关键词的优先级,根据确定的优先级对所述关键词进行排序;Determine the priority of the keywords according to the part of speech corresponding to each keyword, and sort the keywords according to the determined priorities;
根据排序结果依次在数据库中进行检索,得到所述关键词对应的图片。According to the sorting results, the database is searched in sequence to obtain the pictures corresponding to the keywords.
进一步地,处理器1001可以调用存储器1005中存储的图片搜索程序,还执行以下操作:Further, the processor 1001 can call the picture search program stored in the memory 1005, and also perform the following operations:
所述关键词中各词语的优先级从高到低依次为名词、动词和形容词。The priority of each word in the keyword is noun, verb and adjective in descending order.
进一步地,处理器1001可以调用存储器1005中存储的图片搜索程序,还执行以下操作:Further, the processor 1001 can call the picture search program stored in the memory 1005, and also perform the following operations:
确定所述动词和形容词对应于名词的位置,根据所述动词和形容词对应于名词的位置确定所述动词和形容词的优先级。The positions of the verbs and adjectives corresponding to the nouns are determined, and the priority of the verbs and adjectives is determined according to the positions of the verbs and adjectives corresponding to the nouns.
进一步地,处理器1001可以调用存储器1005中存储的图片搜索程序,还执行以下操作:Further, the processor 1001 can call the picture search program stored in the memory 1005, and also perform the following operations:
根据所述关键词中优先级别最高的关键词在数据库中进行检索,获得对应的第一大类图片;Search in the database according to the keyword with the highest priority among the keywords, and obtain the corresponding first category of pictures;
在所述第一大类图片中根据各关键词的优先顺序依次进行检索,获得对应的图片。The first category of pictures is searched in sequence according to the priority order of each keyword to obtain corresponding pictures.
进一步地,处理器1001可以调用存储器1005中存储的图片搜索程序,还执行以下操作:Further, the processor 1001 can call the picture search program stored in the memory 1005, and also perform the following operations:
分别以优先级别最高的词类中的每个关键词进行检索,获得对应的多个第一大类图片。Respectively search for each keyword in the word class with the highest priority, and obtain a plurality of corresponding first-class pictures.
进一步地,处理器1001可以调用存储器1005中存储的图片搜索程序,还执行以下操作:Further, the processor 1001 can call the picture search program stored in the memory 1005, and also perform the following operations:
获得语音信息;get voice information;
将所述语音信息进行文字转换,转化为文本信息。The voice information is converted into text information by text conversion.
本发明图片搜索设备的具体实施例与下述图片搜索方法各实施例基本相同,在此不作赘述。The specific embodiments of the picture search device of the present invention are basically the same as the embodiments of the following picture search methods, and are not repeated here.
参照图2,图2为本发明图片搜索方法第一实施例的流程示意图,所述图片搜索方法包括:Referring to FIG. 2, FIG. 2 is a schematic flowchart of a first embodiment of a picture search method according to the present invention. The picture search method includes:
步骤S100,获得文本信息;Step S100, obtaining text information;
本发明主要是根据文本信息进行图片搜索,搜索与文本信息相关的图片。在本实施例中,可以根据播放的语音信息或者电子文档等多种途径获得需要进行图片搜索的文本信息,本发明对文本信息的获取方式不作限定。该文本信息为文字信息,可以为一篇文章如某一篇童话故事,或者用户输入的一段话,也可以是根据用户输入的语音进行文字转换过来的文本信息等。该文本信息可以为一句话,也可以为长段文字,对文本信息的长度也不做限定。例如,可以从少儿读物电子书中获取一段文字,获得的该段文字为本发明所说的文本信息。The present invention mainly searches for pictures according to text information, and searches for pictures related to the text information. In this embodiment, the text information that needs to be searched for pictures can be obtained according to various ways such as played voice information or electronic documents, and the present invention does not limit the way of obtaining the text information. The text information is text information, which can be an article such as a fairy tale, or a paragraph input by the user, or text information converted from text according to the voice input by the user. The text information may be a sentence or a long text, and the length of the text information is not limited. For example, a paragraph of text may be obtained from an electronic book of children's books, and the obtained paragraph of text is the text information mentioned in the present invention.
步骤S200,对所述文本信息进行关键词提取,获得所述文本信息的关键词;Step S200, performing keyword extraction on the text information to obtain keywords of the text information;
在获得文本信息后,对文本信息进行关键词提取,可以根据文本信息的句子结构根据文本信息中的各词语的词类进行关键词提取,还可以通过其他方式提取。如提取某一句话其中的名词词语,动词词语等为关键词。词语有多种词类,如名词,动词,形容词,副词等十四类词语词类。After the text information is obtained, keyword extraction is performed on the text information. The keyword extraction may be performed according to the sentence structure of the text information according to the part of speech of each word in the text information, and may also be extracted by other methods. For example, the noun words, verb words, etc. in a sentence are extracted as keywords. Words have a variety of parts of speech, such as nouns, verbs, adjectives, adverbs and other fourteen types of word parts of speech.
步骤S300,根据所述关键词在预置的图库中进行检索,获得与所述关键词对应的图片。Step S300, searching in a preset gallery according to the keyword to obtain a picture corresponding to the keyword.
在本实施例中,根据关键词在预置的图库中进行检索,预置的图库包含多张图片,每张图片都有相应的标签,并根据图片的标签将图片进行分类,通过关键词与预设的图库中的图片标签进行比对,就能获得与关键词相关的图片。这样就可以利用关键词在预置的图库中进行检索,获得与关键词对应的图片。In this embodiment, retrieval is performed in a preset gallery according to keywords. The preset gallery contains multiple pictures, each picture has a corresponding label, and the pictures are classified according to the labels of the pictures. By comparing the image tags in the preset gallery, you can obtain images related to keywords. In this way, the keywords can be used to search in the preset gallery, and the pictures corresponding to the keywords can be obtained.
在获得文本信息中的关键词后,对关键词进行排序,使关键词有一个优先顺序,如名词词语优于动词词语,而动词词语优于形容词词语等,然后根据词类词语的优先顺序在数据库中进行搜索,先根据前面的词类词语搜索一个图片大集合,然后根据后面的词类词语在前面的图片大集合中以逐渐缩小的方式进行模糊匹配得到图片小集合,直到最后搜索得出对应的图片,当然也可以采用关键词组合等方式在预置的图库中进行检索,获得与关键词对应的图片。After obtaining the keywords in the text information, sort the keywords so that the keywords have a priority order, such as noun words are better than verb words, and verb words are better than adjective words, etc., and then according to the priority order of part of speech words in the database First, search a large set of pictures according to the previous part of speech words, and then perform fuzzy matching in the previous large set of pictures according to the following part of speech words in a gradually narrowing manner to obtain a small set of pictures, until the final search results in the corresponding picture , of course, a combination of keywords can also be used to search in a preset gallery to obtain a picture corresponding to the keyword.
在前面的图片大集合中根据后面的词类词语进行搜索时,如果搜索得到的是一张图片,则该图片就是我们需要图片,但多数时候,可能搜索不到相应的图片,则返回前面的图片大集合中的一张图片为关键词对应的图片,该图片可以为前面的图片大集合中的首张图片,也可以是根据其他要求或规则设定的其他图片。When searching according to the following part-of-speech words in the previous large collection of pictures, if the search result is a picture, then the picture is the picture we need, but most of the time, the corresponding picture may not be found, and the previous picture is returned. A picture in the large set is the picture corresponding to the keyword, which can be the first picture in the previous large set of pictures, or other pictures set according to other requirements or rules.
本发明提供一种图片搜索方法、装置和计算机存储介质。在该方法中,接收图片搜索指令,并根据图片搜索指令获得文本信息;对所述文本信息进行关键词提取,获得所述文本信息的关键词;根据所述关键词在预置的图库中进行检索,获得与所述关键词对应的图片。通过上述方式,本发明能够实现根据获得的文本资料自动搜索相关的图片,使搜索到的图片能够插入文本信息中作为文本插图进行展示,进而使文本资料更加生动形象,丰富文本信息的表现形式,更加有益于读者,特别是小朋友进行阅读理解。The present invention provides a picture search method, device and computer storage medium. In this method, a picture search instruction is received, and text information is obtained according to the picture search instruction; keyword extraction is performed on the text information to obtain keywords of the text information; Search to obtain a picture corresponding to the keyword. Through the above method, the present invention can automatically search for relevant pictures according to the obtained text data, so that the searched pictures can be inserted into the text information and displayed as text illustrations, thereby making the text data more vivid and enriching the expression form of the text information, It is more beneficial to readers, especially children's reading comprehension.
请参阅图3,图3为本发明图片搜索方法第二实施例的流程示意图。Please refer to FIG. 3 , which is a schematic flowchart of a second embodiment of a picture search method according to the present invention.
基于上述实施例,本实施例中,步骤S200包括:Based on the foregoing embodiment, in this embodiment, step S200 includes:
步骤S210,对所述文本信息进行词类划分,划分为多个词类词语;Step S210, the text information is divided into parts of speech, and divided into multiple parts of speech words;
本实施例是对对所述文本信息进行关键词提取,获得文本信息中的关键词解释说明的一个实施例。获得文本信息后,先根据文本信息,对文本信息中的进行词类的划分,将文本信息划分为多个词类词语,如多个名词词语,多个动词词语,多个形容词词语等词语模式。如文本信息为“白雪公主在吃苹果”,根据词语的词类,可以将该文本划分为名词“白雪公主”“苹果”,动词“吃”,副词“在”。This embodiment is an embodiment of performing keyword extraction on the text information to obtain keyword explanations in the text information. After obtaining the text information, firstly, according to the text information, the parts of speech in the text information are divided, and the text information is divided into multiple parts of speech words, such as multiple noun words, multiple verb words, multiple adjective words and other word patterns. For example, the text information is "Snow White is eating apples", according to the word class, the text can be divided into nouns "Snow White" and "apples", verbs "eat", and adverbs "zai".
步骤S220,对所述多个词类词语进行筛选,选择预设词类的词为关键词。Step S220: Screening the multiple part-of-speech words, and selecting a word of a preset part-of-speech as a keyword.
然后对划分的多个词类词语根据词语的词性进行筛选,选择预设词类的词语为关键词,如选择其中的名词词语,动词词语和形容词词语为关键词。选择的词语词性可以依情况进行设定。如在文本信息“白雪公主在吃苹果”中选择名词“白雪公主”“苹果”,动词“吃”为关键词。Then, the divided part-of-speech words are screened according to the part-of-speech of the words, and the words of the preset part-of-speech are selected as keywords, for example, noun words, verb words and adjective words are selected as keywords. The part of speech of the selected word can be set according to the situation. For example, in the text information "Snow White is eating apples", the nouns "Snow White" and "apple" are selected, and the verb "eat" is the keyword.
请参阅图4,图4为本发明图片搜索方法第三实施例的流程示意图。Please refer to FIG. 4 , which is a schematic flowchart of a third embodiment of a picture search method according to the present invention.
基于上述实施例,本实施例中,步骤S300包括:Based on the foregoing embodiment, in this embodiment, step S300 includes:
步骤S310,根据各关键词对应的词类确定所述关键词的优先级,根据确定的优先级对所述关键词进行排序;Step S310, determining the priority of the keywords according to the part of speech corresponding to each keyword, and sorting the keywords according to the determined priorities;
在本实施例中,根据所述关键词在预置的词库中进行检索,获得所述关键词对应的图片,可以先根据各关键词所对应的词类进行排序,如将关键词中名词词语设为优先级最高的词类词语,其次是动词词语,形容词词语。这样,设定的各词语的优先级从高到底依次为名词、动词和形容词。也可以选择其他的排序规则来进行关键词的排序。In this embodiment, searching in a preset thesaurus according to the keywords to obtain pictures corresponding to the keywords may first be sorted according to the parts of speech corresponding to the keywords, for example, noun words in the keywords Set to the highest priority part-of-speech words, followed by verb words, and adjective words. In this way, the priorities of the set words are nouns, verbs and adjectives in descending order. You can also choose other sorting rules to sort keywords.
进一步地,在本实施例中,在确定各词语的优先级从高到低依次为名词、动词和形容词后,名词词语为第一优先搜索词语之后,动词和形容词可以依据如下规则设定:确定所述动词和形容词对应于名词的位置,根据所述动词和形容词对应于名词的位置确定所述动词和形容词的优先级。Further, in this embodiment, after it is determined that the priorities of each word are nouns, verbs and adjectives in descending order, and after the noun words are the first priority search words, the verbs and adjectives can be set according to the following rules: determine The verbs and adjectives correspond to the positions of the nouns, and the priority of the verbs and adjectives is determined according to the positions of the verbs and adjectives corresponding to the nouns.
先确定动词和形容词对应于名词的位置,然后根据所述动词和形容词对应于名词的位置来确定动词和形容词的优先级,如位于名词的前面的形容词优先于位于名词的后面的形容词,位于名词前面的动词优于位于名词后面的动词。First determine the positions of the verbs and adjectives corresponding to the noun, and then determine the priority of the verbs and adjectives according to the positions of the verbs and adjectives corresponding to the noun. Verbs in front take precedence over verbs that follow nouns.
步骤S320,根据排序结果依次在数据库中进行检索,得到所述关键词对应的图片。Step S320, according to the sorting result, the database is searched in sequence to obtain the picture corresponding to the keyword.
在获得关键词的优先级顺序后,在依次根据关键词的优先级在数据库中进行检索,得到关键词对应的图片。该检索方式为根据排在前面的词语进行检索,先检索出一个大类,然后在检测出来的大类中,在根据排在后面的词语进行检索,检索出一个小类,以此为规律进行检索,检索出我们需要的图片。After the priority order of the keywords is obtained, searches are performed in the database according to the priorities of the keywords in order to obtain pictures corresponding to the keywords. The retrieval method is to retrieve according to the words in the front, first retrieve a large category, and then in the detected large category, retrieve a small category based on the words in the back, and use this as a rule. Retrieve, retrieve the pictures we need.
同样的,在名词搜索的大类图片中,先根据前面的形容词进行搜索,搜索该名词的形容词对应的小类图片,再在这小类图片中根据后面的形容词进行进一步的搜索。如文本信息“蓝色的海很美”,先根据名词“海”进行搜索,搜索出名词“海”对应的图片大类,然后,在名词“海”这个大类中,搜索形容词“蓝色的”对应的图片小类,再在形容词“蓝色的”对应的图片小类中,搜索形容词“美”对应的图片小类。通过这样的方式搜索出与文本信息对应的的图片。Similarly, in the large category of pictures searched for by nouns, first search based on the preceding adjectives, search for the sub-category pictures corresponding to the adjectives of the noun, and then perform further searches based on the following adjectives in this sub-category of pictures. For example, the text information "The blue sea is beautiful", first search according to the noun "sea", and search for the picture category corresponding to the noun "sea", and then, in the category of the noun "sea", search for the adjective "blue" The picture sub-category corresponding to the adjective "blue", and then search for the picture sub-category corresponding to the adjective "beautiful" in the picture sub-category corresponding to the adjective "blue". In this way, the pictures corresponding to the text information are searched.
请参阅图5,图5为本发明图片搜索方法第四实施例的流程示意图。Please refer to FIG. 5 , which is a schematic flowchart of a fourth embodiment of a picture search method according to the present invention.
基于上述实施例,本实施例中,步骤S320包括:Based on the foregoing embodiment, in this embodiment, step S320 includes:
步骤S321,根据所述关键词中优先级别最高的关键词在数据库中进行检索,获得对应的第一大类图片;Step S321, searching in the database according to the keyword with the highest priority in the keywords, and obtaining the corresponding first category of pictures;
根据文本信息的句子结构,当提取出的关键词较少时,如提取出的关键词只有一个名词,一个动词时,就可以先根据这一个名词先搜索出一个大类。当文本信息较长时,根据文本信息的句子结构,当提取出的关键词较多时,如提取出的关键词为多个名词,多个动词,多个形容词时,依据优先级顺序,如名词优于动词,动词优于形容词,就将最高优先级词类词语多个名词分别进行检索,检索出多个第一大类图片。例如:文本信息“小朋友摔倒在黑色的地板上”,根据文本信息,提取出关键词名词“小朋友”“地板”动词“摔倒”形容词“黑色的”,则先根据最高级词类名词搜索第一大类图片,即,根据“小朋友”搜索出一个大类图片集,根据“地板”又搜索出一个大类图片集,即根据两个不同名词分别搜索出两个并列不同的第一大类图片。According to the sentence structure of the text information, when the extracted keywords are few, for example, when the extracted keywords have only one noun and one verb, you can first search for a large category based on this noun. When the text information is long, according to the sentence structure of the text information, when there are many keywords extracted, such as the extracted keywords are multiple nouns, multiple verbs, multiple adjectives, according to the priority order, such as nouns If the verb is superior to the verb, and the verb is superior to the adjective, the highest priority word class words and multiple nouns are retrieved separately, and a plurality of first-class pictures are retrieved. For example: text information "child fell on the black floor", according to the text information, extract the keyword noun "child" "floor" verb "fall down" adjective "black", then first search for the first according to the highest part of speech noun A large category of pictures, that is, a large category of pictures is searched according to "children", and a large category of pictures is searched according to "floor", that is, two juxtaposed first categories are searched according to two different nouns. picture.
步骤S322,在所述第一大类图片中根据各关键词的优先顺序依次进行检索,获得对应的图片。Step S322: Search in the first category of pictures in sequence according to the priority order of each keyword to obtain a corresponding picture.
在检索出第一大类图片之后,在根据词语的优先级顺序依次进行检索。但当优先级别最高的关键词包括多个时,分别以优先级别最高的词类中的每个关键词进行检索,获得对应的多个第一大类图片。如当提取出的关键词较多时,如提取的关键词为多个名词,多个动词,多个形容词时,在根据多个名词检索出多个第一大类图片之后,再根据各个名词相应的动词和形容词按照优先级顺序依次进行检索,检索出各个图片小类。例如:文本信息“小朋友摔倒在黑色的地板上”,根据文本信息,在根据名词“小朋友”“地板”搜索出两个不同的第一大类图片之后,在第一个图片大类名词“小朋友”对应的第一大类图片中,根据名词“小朋友”相应的动词“摔倒”进行第二次搜索,搜索出“摔倒”对应的第二图片大类;在第二个图片大类名词“地板”对应的第一大类图片中,在根据名词“地板”相应的形容词“黑色的”进行第二次搜索,搜索出“黑色的”对应的第二图片大类。这样,根据该文本信息,就搜索出两张图片,一张“小朋友”/“摔倒”搜索出来的图片,一张“地板”/“黑色的”搜索出来的图片。After the first category of pictures is retrieved, the retrieval is performed in sequence according to the priority order of the words. However, when there are multiple keywords with the highest priority, each keyword in the class of speech with the highest priority is searched to obtain a plurality of corresponding pictures of the first category. For example, when there are many keywords extracted, such as multiple nouns, multiple verbs, and multiple adjectives, after retrieving multiple first-category pictures according to multiple nouns, then according to the corresponding nouns The verbs and adjectives are retrieved in order of priority, and each picture sub-category is retrieved. For example: text information "The child fell on the black floor", according to the text information, after searching for two different first category pictures based on the nouns "children" and "floor", in the first picture category noun " In the first category of pictures corresponding to "children", a second search is performed according to the verb "fall" corresponding to the noun "children", and the second category of pictures corresponding to "fall" is found; in the second category of pictures In the first category of pictures corresponding to the noun "floor", a second search is performed according to the adjective "black" corresponding to the noun "floor", and the second category of pictures corresponding to "black" is searched. In this way, according to the text information, two pictures are searched, one is searched for "children"/"fallen", and the other is searched for "floor"/"black".
请参阅图6,图6为本发明图片搜索方法第五实施例的流程示意图。Please refer to FIG. 6 , which is a schematic flowchart of a fifth embodiment of a picture search method according to the present invention.
基于上述实施例,本实施例中,步骤S100包括:Based on the foregoing embodiment, in this embodiment, step S100 includes:
步骤S110,获得语音信息;Step S110, obtaining voice information;
步骤S120,将所述语音信息进行文字转换,转化为文本信息。Step S120, performing text conversion on the voice information to convert it into text information.
在本实施例中,也可以获得用户输入的语音信息,当用户输入语音信息之后,将用户输入的语音信息进行文字转化,转化为文本信息,进而根据文本信息进行关键词的提取和图片搜索,通过这种方式,可以扩大文本的范围,使本方案更加有利于应用,使用户有更好的使用体验。In this embodiment, the voice information input by the user can also be obtained. After the user inputs the voice information, the voice information input by the user is converted into text, and then keyword extraction and image search are performed according to the text information. In this way, the scope of the text can be expanded, the solution is more beneficial to the application, and the user has a better use experience.
此外,本发明实施例还提出一种计算机可读存储介质。In addition, the embodiments of the present invention also provide a computer-readable storage medium.
本发明计算机可读存储介质上存储有图片搜索程序,所述图片搜索程序被处理器执行时实现如上所述的图片搜索方法的步骤。The computer-readable storage medium of the present invention stores a picture search program, and when the picture search program is executed by the processor, implements the steps of the above-mentioned picture search method.
其中,在所述处理器上运行的图片搜索程序被执行时所实现的方法可参照本发明图片搜索方法各个实施例,此处不再赘述。For the method implemented when the picture search program running on the processor is executed, reference may be made to the various embodiments of the picture search method of the present invention, which will not be repeated here.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者系统不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者系统所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者系统中还存在另外的相同要素。It should be noted that, herein, the terms "comprising", "comprising" or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article or system comprising a series of elements includes not only those elements, It also includes other elements not expressly listed or inherent to such a process, method, article or system. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in the process, method, article or system that includes the element.
上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。The above-mentioned serial numbers of the embodiments of the present invention are only for description, and do not represent the advantages or disadvantages of the embodiments.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本发明各个实施例所述的方法。From the description of the above embodiments, those skilled in the art can clearly understand that the method of the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is better implementation. Based on such understanding, the technical solutions of the present invention can be embodied in the form of software products in essence or the parts that make contributions to the prior art, and the computer software products are stored in a storage medium (such as ROM/RAM) as described above. , magnetic disk, optical disk), including several instructions to make a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) execute the methods described in the various embodiments of the present invention.
以上仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。The above are only preferred embodiments of the present invention, and are not intended to limit the scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the description and drawings of the present invention, or directly or indirectly applied in other related technical fields , are similarly included in the scope of patent protection of the present invention.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910210621.5A CN109933681A (en) | 2019-03-19 | 2019-03-19 | Image searching method, device and computer readable storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910210621.5A CN109933681A (en) | 2019-03-19 | 2019-03-19 | Image searching method, device and computer readable storage medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN109933681A true CN109933681A (en) | 2019-06-25 |
Family
ID=66987641
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201910210621.5A Pending CN109933681A (en) | 2019-03-19 | 2019-03-19 | Image searching method, device and computer readable storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN109933681A (en) |
Cited By (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111125408A (en) * | 2019-10-11 | 2020-05-08 | 平安科技(深圳)有限公司 | Search method and device based on feature extraction, computer equipment and storage medium |
| CN111159442A (en) * | 2019-12-27 | 2020-05-15 | 上海擎感智能科技有限公司 | Picture search system, method, medium, and apparatus based on voice |
| CN111414509A (en) * | 2020-03-20 | 2020-07-14 | 支付宝(杭州)信息技术有限公司 | Method and device for providing picture material for small program |
| CN111581977A (en) * | 2020-03-31 | 2020-08-25 | 西安电子科技大学 | Text information conversion method, system, storage medium, computer program, and terminal |
| CN112926300A (en) * | 2021-03-31 | 2021-06-08 | 深圳市优必选科技股份有限公司 | Image searching method, image searching device and terminal equipment |
| CN113342179A (en) * | 2021-05-26 | 2021-09-03 | 北京百度网讯科技有限公司 | Processing method, device, electronic device and storage medium for inputting text |
| CN114116736A (en) * | 2020-09-01 | 2022-03-01 | 上海智臻智能网络科技股份有限公司 | Knowledge base updating method and device, knowledge base updating verification method and device, and knowledge base-based searching method and device |
| CN114116956A (en) * | 2020-09-01 | 2022-03-01 | 上海智臻智能网络科技股份有限公司 | Retrieval method and device |
| CN114238604A (en) * | 2021-12-15 | 2022-03-25 | 展讯通信(天津)有限公司 | Chip register retrieval method and device and electronic equipment |
| CN119739882A (en) * | 2024-06-20 | 2025-04-01 | 华为技术有限公司 | Picture display method, electronic device, and computer-readable storage medium |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103838724A (en) * | 2012-11-20 | 2014-06-04 | 百度在线网络技术(北京)有限公司 | Image search method and device |
| CN104123302A (en) * | 2013-04-27 | 2014-10-29 | 四川火狐无线科技有限公司 | Searching method, device and system |
| CN104239535A (en) * | 2014-09-22 | 2014-12-24 | 重庆邮电大学 | Method and system for matching pictures with characters, server and terminal |
-
2019
- 2019-03-19 CN CN201910210621.5A patent/CN109933681A/en active Pending
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103838724A (en) * | 2012-11-20 | 2014-06-04 | 百度在线网络技术(北京)有限公司 | Image search method and device |
| CN104123302A (en) * | 2013-04-27 | 2014-10-29 | 四川火狐无线科技有限公司 | Searching method, device and system |
| CN104239535A (en) * | 2014-09-22 | 2014-12-24 | 重庆邮电大学 | Method and system for matching pictures with characters, server and terminal |
Cited By (12)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111125408A (en) * | 2019-10-11 | 2020-05-08 | 平安科技(深圳)有限公司 | Search method and device based on feature extraction, computer equipment and storage medium |
| CN111125408B (en) * | 2019-10-11 | 2023-08-29 | 平安科技(深圳)有限公司 | Searching method, searching device, computer equipment and storage medium based on feature extraction |
| CN111159442A (en) * | 2019-12-27 | 2020-05-15 | 上海擎感智能科技有限公司 | Picture search system, method, medium, and apparatus based on voice |
| CN111414509A (en) * | 2020-03-20 | 2020-07-14 | 支付宝(杭州)信息技术有限公司 | Method and device for providing picture material for small program |
| CN111414509B (en) * | 2020-03-20 | 2023-06-02 | 支付宝(杭州)信息技术有限公司 | Method and device for providing picture materials for applets |
| CN111581977A (en) * | 2020-03-31 | 2020-08-25 | 西安电子科技大学 | Text information conversion method, system, storage medium, computer program, and terminal |
| CN114116736A (en) * | 2020-09-01 | 2022-03-01 | 上海智臻智能网络科技股份有限公司 | Knowledge base updating method and device, knowledge base updating verification method and device, and knowledge base-based searching method and device |
| CN114116956A (en) * | 2020-09-01 | 2022-03-01 | 上海智臻智能网络科技股份有限公司 | Retrieval method and device |
| CN112926300A (en) * | 2021-03-31 | 2021-06-08 | 深圳市优必选科技股份有限公司 | Image searching method, image searching device and terminal equipment |
| CN113342179A (en) * | 2021-05-26 | 2021-09-03 | 北京百度网讯科技有限公司 | Processing method, device, electronic device and storage medium for inputting text |
| CN114238604A (en) * | 2021-12-15 | 2022-03-25 | 展讯通信(天津)有限公司 | Chip register retrieval method and device and electronic equipment |
| CN119739882A (en) * | 2024-06-20 | 2025-04-01 | 华为技术有限公司 | Picture display method, electronic device, and computer-readable storage medium |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN109933681A (en) | Image searching method, device and computer readable storage medium | |
| JP4904255B2 (en) | Image processing system and method | |
| CN110852100B (en) | Keyword extraction method, device, electronic equipment and medium | |
| CN114564666B (en) | Encyclopedia information display method, device, equipment and medium | |
| CN103914513B (en) | A kind of entity input method and device | |
| US8874590B2 (en) | Apparatus and method for supporting keyword input | |
| CN110989847B (en) | Information recommendation method, device, terminal equipment and storage medium | |
| US20230252069A1 (en) | Associating a graphical element to media content item collections | |
| CN113204691B (en) | Information display method, device, equipment and medium | |
| KR102712013B1 (en) | Method and device for transmitting information | |
| WO2023160555A1 (en) | Encyclopedic information display method and apparatus, device, and medium | |
| CN109933805B (en) | Text parsing method, system and computer readable storage medium | |
| CN110929122B (en) | Data processing method and device for data processing | |
| US20140059070A1 (en) | Non-transitory computer readable medium, information search apparatus, and information search method | |
| CN114005065B (en) | Method and device for identifying video scene, storage medium and electronic equipment | |
| CN112182179B (en) | Entity question-answer processing method and device, electronic equipment and storage medium | |
| JP2001188795A (en) | Electronic device having communication function with electronic dictionary, and storage medium storing electronic dictionary and electronic device control program | |
| CN113515601A (en) | Question-answer pair generation method, device, device and storage medium | |
| CN113221572B (en) | Information processing method, device, equipment and medium | |
| CN115292505A (en) | Public opinion-based market analysis method, device, equipment and readable storage medium | |
| CN113744014B (en) | Item information monitoring method, device, equipment and computer-readable storage medium | |
| CN110717066A (en) | Intelligent searching method based on audio electronic book and electronic equipment | |
| JP7323484B2 (en) | Information processing device, information processing method, and program | |
| KR100878293B1 (en) | Cyber brain system | |
| CN114330326B (en) | Method and device for processing personalized word library |
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 | ||
| RJ01 | Rejection of invention patent application after publication | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190625 |