Sentiment Analysis Expand Contractions

4 ビュー (過去 30 日間)
MT_22
MT_22 2022 年 9 月 14 日
回答済み: John D'Errico 2022 年 9 月 14 日
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.

カテゴリ

Find more on Environment and Settings in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by