Sentiment Analysis Expand Contractions

4 visualizaciones (últimos 30 días)
MT_22
MT_22 el 14 de Sept. de 2022
Respondida: John D'Errico el 14 de Sept. de 2022
Hello,
I'm currently preprocessing my data for sentiment analysis. In Python there is the possibility to expand contractions (contractions are words or combinations of words that are shortened by dropping letters and replacing them by an apostrophe e.g. change didn't to did not, aren't to are not etc.).
Is this also possible within matlab?
Thanks for your help!

Respuestas (1)

John D'Errico
John D'Errico el 14 de Sept. de 2022
Is it possible? Of course. Search for the possible contractions. Replace them with uncontracted forms. Note that SOME forms would not be appropriate for replacement. My name, for example. So an automatic scheme would be problematic. But as long as you have a list of valid forms to replace, this is nothing more than a find and replace.
You can use tools like regexp or strfind to locate the contractions that would be replaced. At that point, the replacement would be simple.

Categorías

Más información sobre Install Products en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by