Sentiment Analysis Expand Contractions

4 次查看(过去 30 天)
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!

回答(1 个)

John D'Errico
John D'Errico 2022-9-14
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.

类别

Help CenterFile Exchange 中查找有关 Install Products 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by