removing words from texts with 'removeWords' ???

3 visualizaciones (últimos 30 días)
Kamyar Mazarei
Kamyar Mazarei el 2 de Mayo de 2021
Respondida: KSSV el 3 de Mayo de 2021
hi
i want to remove 150 words from 2226 texts (1x150 and 1x2226 matrixes)
i googled it and this came up
but when i use it in matlab it says: Undefined function or variable 'removeWords'.
i also cant find it on my matlabs search tab
is this for another version?
is there another code?
if not can you help me pelase
thank you
  2 comentarios
dpb
dpb el 2 de Mayo de 2021
As the link indicates by containing the folder "textanalytics", this is a function in the <Text Analytics Toolbox>
You must have a license for the Toolbox to use the function.
You can do such operations with the builtin string handling functions; if we had actual sample of your dataset would be far easier to suggest specific code for the purpose.
Kamyar Mazarei
Kamyar Mazarei el 3 de Mayo de 2021
oh i see
sry im new to matlab didnt notice that
lets say matrix A is 2226 texts
and marix B is 150 words i want to remove
i wanted something like A=removewords(A,B)

Iniciar sesión para comentar.

Respuestas (1)

KSSV
KSSV el 3 de Mayo de 2021
str1 = 'Hello world, how are you?' ;
str2 = 'how are you?' ;
str=setdiff(strsplit(str1),strsplit(str2))
str = 1×2 cell array
{'Hello'} {'world,'}

Categorías

Más información sobre Workspace Variables and MAT-Files en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by