synonym

Return a list of matches by given phrase

喜欢而已 提交于 2019-12-19 11:29:20
问题 I'm trying to make a method which can check whether a given phrase matches at least one item from list of phrases and returns them. Input is the phrase, a list of phrases and a dictionary of lists of synonyms. The point is to make it universal. Here is the example: phrase = 'This is a little house' dictSyns = {'little':['small','tiny','little'], 'house':['cottage','house']} listPhrases = ['This is a tiny house','This is a small cottage','This is a small building','I need advice'] I can create

Best way to store and retrieve synonyms in database mysql

被刻印的时光 ゝ 提交于 2019-12-18 13:34:11
问题 I am making a synonyms list that I will store it in database and retrieve it before doing full text search. When users enters like: word1 I need to lookup for this word in my synonyms table. So if the word is found, I would SELECT all the synonyms of this word and use it in the fulltext search on the next query where I contruct the query like MATCH (columnname) AGAINST ((word1a word1b word1c) IN BOOLEAN MODE) So how do I store the synonyms in a table? I found 2 choices: using key and word

Good way to do multi-word synonym search

蹲街弑〆低调 提交于 2019-12-13 06:59:26
问题 All: I want to do a multi-word synonym search, to get search to work like: "small dog" means puppy "cute small cat" may refer to kitten [1] I do not know how to define those multi-word phrase in synonyms.txt to make it work. Could anyone ell me how to define those phrase in synonyms.txt [2] Another thing is: Once the synonym can work, how can I match both "small dog" and "little dog" which have similar meaning with puppy? Like: "a small dog" also means "small dog" means puppy "cute cat" may

Synonyms from wordnet package are very incomplete

。_饼干妹妹 提交于 2019-12-13 02:55:52
问题 Synonyms function of wordnet package misses obvious synonyms that the wordnet app does not. How to get that other data out of wordnet using R's wordnet package? I am using R 3.4.4. App shows 9 senses of company Sense 1 company -- (an institution created to conduct business; "he only invests in large well-established companies"; "he started the company in his garage") => institution, establishment -- (an organization founded and united for a specific purpose) Sense 2 company -- (small military

Create a dataframe with NLTK synonyms

℡╲_俬逩灬. 提交于 2019-12-13 02:37:09
问题 Good Morning, I am using NLTK to get synonyms out of a frame of words. print(df) col_1 col_2 Book 5 Pen 5 Pencil 6 def get_synonyms(df, column_name): df_1 = df["col_1"] for i in df_1: syn = wn.synsets(i) for synset in list(wn.all_synsets('n'))[:2]: print(i, "-->", synset) print("-----------") for lemma in synset.lemmas(): print(lemma.name()) ci = lemma.name() return(syn) And it does work, but I would like to get the following dataframe, with the first "n" synonyms, of each word in "col_1":

Why would an Oracle synonym return a different number of rows to the underlying table?

两盒软妹~` 提交于 2019-12-12 10:57:43
问题 I have a very unusual situation that I am hoping someone will be able to shed some light onto. My understanding of an oracle synonym is that it is basically an alias to a table in another schema. When I do a count from the synonym, it returns zero rows. When I do the same from the underlying table, it returns 12 thousand rows. I cannot explain this discrepancy. Can anyone help? select * from dba_synonyms where synonym_name = 'CS_INCIDENTS_B_SEC'; OWNER SYNONYM_NAME TABLE_OWNER TABLE_NAME DB

Iterate one list of synsets over another

别等时光非礼了梦想. 提交于 2019-12-12 04:53:24
问题 I have two sets of wordnet synsets (contained in two separate list objects, s1 and s2), from which I want to find the maximum path similarity score for each synset in s1 onto s2 with the length of output equal that of s1. For example, if s1 contains 4 synsets, then the length of output should be 4. I have experimented with the following code (so far): import numpy as np import nltk from nltk.corpus import wordnet as wn import pandas as pd #two wordnet synsets (s1, s2) s1 = [wn.synset('be.v.01

Elastic synonym usage in aggregations

给你一囗甜甜゛ 提交于 2019-12-11 15:24:26
问题 Situation : Elastic version used: 2.3.1 I have an elastic index configured like so PUT /my_index { "settings": { "analysis": { "filter": { "my_synonym_filter": { "type": "synonym", "synonyms": [ "british,english", "queen,monarch" ] } }, "analyzer": { "my_synonyms": { "tokenizer": "standard", "filter": [ "lowercase", "my_synonym_filter" ] } } } } } Which is great, when I query the document and use a query term " english " or " queen " I get all documents matching british and monarch . When I

Public Synonyms vs. schema.object pattern

回眸只為那壹抹淺笑 提交于 2019-12-11 11:36:59
问题 In my application there are going to be lots of users, over 500. They only deal with one schema objects. I've granted the necessary privileges. When I say: SELECT * FROM EMP; I get the "table or view does not exists" error, so it means: I either need to specify the owner name before the objects. like SCOTT.EMP , or I can create public synonyms for all the objects that I'll be refering to. My concern is, if public synonyms can have impact on the performance with this many users with an

synonyms offline Dictionary for a search application

主宰稳场 提交于 2019-12-11 10:26:24
问题 i'm trying to build a smart search engine application that gets synonyms of the words in the Question and Query my database with each of the generated synonyms the problem is that i'm searching for a way to get all synonyms of the words in the Question using a dictionary or something. that could in the end offers 1- direct synonyms like : file > movie , football > soccer 2- could offer a matchstring like : population size > number of citizens (optional ) 3- something that is fast and reliable