我有一个列有一长串和需要计数的最常用的词。
我需要的东西,这样工作 https://towardsdatascience.com/very-simple-python-script-for-extracting-most-common-words-from-a-story-1e3570d0b9d0. 该计数字的部分至少...
这是非常重要的,我已经选择黑名单的一些话,使他们不计数。
我有一个列有一长串和需要计数的最常用的词。
我需要的东西,这样工作 https://towardsdatascience.com/very-simple-python-script-for-extracting-most-common-words-from-a-story-1e3570d0b9d0. 该计数字的部分至少...
这是非常重要的,我已经选择黑名单的一些话,使他们不计数。
试试下面简单的方法
with blacklist as (
select 'with' word union all
select 'that' union all
select 'add more as you see needed'
)
select lower(word) word, count(*) frequency
from data, unnest(regexp_extract_all(col, r'[\w]*')) word
where length(word) > 3
and word not in (select word from blacklist)
group by word
order by frequency desc