-
Notifications
You must be signed in to change notification settings - Fork 861
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Major stopword differences with "stopword" package (inaccurate data?) #651
Comments
And here's the script comparing in reverse (all the keys in const _ = require('lodash');
const sw = require('stopword');
const stopwordsEn = _.difference(
sw.eng,
require('natural/lib/natural/util/stopwords').words
);
console.log('EN');
console.log(JSON.stringify(stopwordsEn, null, 2));
const stopwordsEs = _.difference(
sw.spa,
require('natural/lib/natural/util/stopwords_es').words
);
console.log('ES');
console.log(JSON.stringify(stopwordsEs, null, 2));
const stopwordsFa = _.difference(
sw.fas,
require('natural/lib/natural/util/stopwords_fa').words
);
console.log('FA');
console.log(JSON.stringify(stopwordsFa, null, 2));
const stopwordsFr = _.difference(
sw.fra,
require('natural/lib/natural/util/stopwords_fr').words
);
console.log('FR');
console.log(JSON.stringify(stopwordsFr, null, 2));
const stopwordsId = _.difference(
sw.ind,
require('natural/lib/natural/util/stopwords_id').words
);
console.log('ID');
console.log(JSON.stringify(stopwordsId, null, 2));
const stopwordsJa = _.difference(
sw.jpn,
require('natural/lib/natural/util/stopwords_ja').words
);
console.log('JA');
console.log(JSON.stringify(stopwordsJa, null, 2));
const stopwordsIt = _.difference(
sw.ita,
require('natural/lib/natural/util/stopwords_it').words
);
console.log('IT');
console.log(JSON.stringify(stopwordsIt, null, 2));
const stopwordsNl = _.difference(
sw.nld,
require('natural/lib/natural/util/stopwords_nl').words
);
console.log('NL');
console.log(JSON.stringify(stopwordsNl, null, 2));
const stopwordsNo = _.difference(
sw.nob,
require('natural/lib/natural/util/stopwords_no').words
);
console.log('NO');
console.log(JSON.stringify(stopwordsNo, null, 2));
const stopwordsPl = _.difference(
sw.pol,
require('natural/lib/natural/util/stopwords_pl').words
);
console.log('PL');
console.log(JSON.stringify(stopwordsPl, null, 2));
const stopwordsPt = _.difference(
[...sw.por, ...sw.porBr],
require('natural/lib/natural/util/stopwords_pt').words
);
console.log('PT');
console.log(JSON.stringify(stopwordsPt, null, 2));
const stopwordsRu = _.difference(
sw.rus,
require('natural/lib/natural/util/stopwords_ru').words
);
console.log('RU');
console.log(JSON.stringify(stopwordsRu, null, 2));
const stopwordsSv = _.difference(
sw.swe,
require('natural/lib/natural/util/stopwords_sv').words
);
console.log('SV');
console.log(JSON.stringify(stopwordsSv, null, 2));
const stopwordsZh = _.difference(
sw.zho,
require('natural/lib/natural/util/stopwords_zh').words
);
console.log('ZH');
console.log(JSON.stringify(stopwordsZh, null, 2)); Output: ❯ node test
EN
[]
ES
[]
FA
[
"به",
"اکنون",
"اگر",
"اگرچه",
"الا",
"اما",
"اندر",
"اینکه",
"باری",
"بالعکس",
"بدون",
"بر",
"بلکه",
"بنابراین",
"بی",
"پس",
"تا",
"جز",
"چنانچه",
"چه",
"چون",
"در",
"را",
"روی",
"زیرا",
"سپس",
"غیر",
"که",
"لیکن",
"مانند",
"مثل",
"مگر",
"نه",
"نیز",
"هرچند",
"هم",
"همان",
"وانگهی",
"ولی",
"ولو",
"همانند",
"همچو"
]
FR
[]
ID
[
"rata",
"tahun",
"tengah",
"tinggi",
"umum",
"waktu"
]
JA
[]
IT
[]
NL
[]
NO
[]
PL
[]
PT
[
"adeus",
"agora",
"aí",
"ainda",
"além",
"algo",
"alguém",
"algum",
"alguma",
"algumas",
"alguns",
"ali",
"ampla",
"amplas",
"amplo",
"amplos",
"ano",
"anos",
"ante",
"antes",
"apenas",
"apoio",
"após",
"aqui",
"área",
"assim",
"atrás",
"através",
"baixo",
"bastante",
"bem",
"boa",
"boas",
"bom",
"bons",
"breve",
"cá",
"cada",
"catorze",
"cedo",
"cento",
"certamente",
"certeza",
"cima",
"cinco",
"coisa",
"coisas",
"conselho",
"contra",
"contudo",
"custa",
"dá",
"dão",
"daquela",
"daquelas",
"daquele",
"daqueles",
"dar",
"debaixo",
"demais",
"dentro",
"desde",
"dessa",
"dessas",
"desse",
"desses",
"desta",
"destas",
"deste",
"destes",
"deve",
"devem",
"devendo",
"dever",
"deverá",
"deverão",
"deveria",
"deveriam",
"devia",
"deviam",
"dez",
"dezanove",
"dezasseis",
"dezassete",
"dezoito",
"dia",
"diante",
"disse",
"disso",
"disto",
"dito",
"diz",
"dizem",
"dizer",
"dois",
"doze",
"duas",
"dúvida",
"é",
"embora",
"enquanto",
"era",
"eram",
"éramos",
"és",
"está",
"estamos",
"estão",
"estar",
"estás",
"estava",
"estavam",
"estávamos",
"esteja",
"estejam",
"estejamos",
"esteve",
"estive",
"estivemos",
"estiver",
"estivera",
"estiveram",
"estivéramos",
"estiverem",
"estivermos",
"estivesse",
"estivessem",
"estivéssemos",
"estiveste",
"estivestes",
"estou",
"etc",
"exemplo",
"faço",
"falta",
"favor",
"faz",
"fazeis",
"fazem",
"fazemos",
"fazendo",
"fazer",
"fazes",
"feita",
"feitas",
"feito",
"feitos",
"fez",
"fim",
"final",
"foi",
"fomos",
"for",
"fora",
"foram",
"fôramos",
"forem",
"forma",
"formos",
"fosse",
"fossem",
"fôssemos",
"foste",
"fostes",
"fui",
"geral",
"grande",
"grandes",
"grupo",
"há",
"haja",
"hajam",
"hajamos",
"hão",
"havemos",
"havia",
"hei",
"hoje",
"hora",
"horas",
"houve",
"houvemos",
"houver",
"houvera",
"houverá",
"houveram",
"houvéramos",
"houverão",
"houverei",
"houverem",
"houveremos",
"houveria",
"houveriam",
"houveríamos",
"houvermos",
"houvesse",
"houvessem",
"houvéssemos",
"la",
"lá",
"lado",
"lo",
"local",
"logo",
"longe",
"lugar",
"maior",
"maioria",
"mal",
"máximo",
"meio",
"menor",
"menos",
"mês",
"meses",
"mesma",
"mesmas",
"mesmos",
"mil",
"momento",
"muita",
"muitas",
"nada",
"naquela",
"naquelas",
"naquele",
"naqueles",
"nenhum",
"nenhuma",
"nessa",
"nessas",
"nesse",
"nesses",
"nesta",
"nestas",
"neste",
"nestes",
"ninguém",
"nível",
"noite",
"nome",
"nova",
"novas",
"nove",
"novo",
"novos",
"número",
"nunca",
"obra",
"obrigada",
"obrigado",
"oitava",
"oitavo",
"oito",
"onde",
"ontem",
"onze",
"outra",
"outras",
"outro",
"outros",
"parece",
"parte",
"partir",
"paucas",
"pequena",
"pequenas",
"pequeno",
"pequenos",
"per",
"perante",
"perto",
"pode",
"pude",
"pôde",
"podem",
"podendo",
"poder",
"poderia",
"poderiam",
"podia",
"podiam",
"põe",
"põem",
"pois",
"ponto",
"pontos",
"porém",
"porque",
"porquê",
"posição",
"possível",
"possivelmente",
"posso",
"pouca",
"poucas",
"pouco",
"poucos",
"primeira",
"primeiras",
"primeiro",
"primeiros",
"própria",
"próprias",
"próprio",
"próprios",
"próxima",
"próximas",
"próximo",
"próximos",
"pude",
"puderam",
"quáis",
"quanto",
"quantos",
"quarta",
"quarto",
"quatro",
"quê",
"quer",
"quereis",
"querem",
"queremas",
"queres",
"quero",
"questão",
"quinta",
"quinto",
"quinze",
"relação",
"sabe",
"sabem",
"são",
"segunda",
"segundo",
"sei",
"seis",
"seja",
"sejam",
"sejamos",
"sempre",
"sendo",
"ser",
"será",
"serão",
"serei",
"seremos",
"seria",
"seriam",
"seríamos",
"sete",
"sétima",
"sétimo",
"sexta",
"sexto",
"si",
"sido",
"sim",
"sistema",
"sob",
"sobre",
"sois",
"somos",
"sou",
"tal",
"talvez",
"tampouco",
"tanta",
"tantas",
"tanto",
"tão",
"tarde",
"tem",
"tém",
"têm",
"temos",
"tendes",
"tendo",
"tenha",
"tenham",
"tenhamos",
"tenho",
"tens",
"ter",
"terá",
"terão",
"terceira",
"terceiro",
"terei",
"teremos",
"teria",
"teriam",
"teríamos",
"teve",
"ti",
"tido",
"tinha",
"tinham",
"tínhamos",
"tive",
"tivemos",
"tiver",
"tivera",
"tiveram",
"tivéramos",
"tiverem",
"tivermos",
"tivesse",
"tivessem",
"tivéssemos",
"tiveste",
"tivestes",
"toda",
"todas",
"todavia",
"todo",
"todos",
"trabalho",
"três",
"treze",
"tudo",
"última",
"últimas",
"último",
"últimos",
"uns",
"vai",
"vais",
"vão",
"vários",
"vem",
"vêm",
"vendo",
"vens",
"ver",
"vez",
"vezes",
"viagem",
"vindo",
"vinte",
"vir",
"vós",
"vossa",
"vossas",
"zero"
]
RU
[
"не",
"со",
"то",
"она",
"да",
"же",
"вы",
"бы",
"по",
"ее",
"мне",
"было",
"вот",
"меня",
"еще",
"нет",
"ему",
"теперь",
"когда",
"даже",
"ну",
"ли",
"уже",
"ни",
"него",
"вас",
"нибудь",
"уж",
"вам",
"ведь",
"потом",
"себя",
"ничего",
"ей",
"может",
"тут",
"есть",
"надо",
"ней",
"тебя",
"чем",
"была",
"сам",
"чтоб",
"без",
"будто",
"чего",
"раз",
"себе",
"будет",
"тогда",
"того",
"этого",
"какой",
"совсем",
"ним",
"этом",
"почти",
"тем",
"чтобы",
"нее",
"были",
"куда",
"всех",
"сегодня",
"можно",
"при",
"об",
"хоть",
"больше",
"эти",
"нас",
"про",
"всего",
"них",
"какая",
"разве",
"эту",
"моя",
"свою",
"этой",
"перед",
"иногда",
"лучше",
"чуть",
"том",
"нельзя",
"такой",
"им",
"всегда",
"конечно",
"всю",
"это",
"лишь"
]
SV
[]
ZH
[] |
I found these differences due to the word "hello" being in Natural's "id" stopwords list, while not in ❯ node
Welcome to Node.js v16.15.1.
Type ".help" for more information.
> require('stopword').ind.indexOf('hello')
-1
> require('natural/lib/natural/util/stopwords_id').words.indexOf('hello')
267 |
Thanks for your comparison. I think it is a matter of taste and application which words are considers stopwords. For now I will leave it like it is. Maybe in the future we re-use the stopwords package. |
Hello @Hugo-ter-Doest - we may need to update stopwords here, as they are drastically different than the
stopword
package.I ran the following scripts and received diff output, which shows how drastic it is.
Output:
The text was updated successfully, but these errors were encountered: