肯定語と否定語のリストを作る
感情分析用の語彙集
「肯定語と否定語のリストを作る」はCoddyKit上の無料NLP Academyレッスンです。 これはレッスン2/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これはNLP Academy学習パスの一部であり、ウェブとCoddyKitアプリ全体で進捗が同期されます。 NLP Academyコースには全4レッスンが含まれています。
このレッスンの一部はまだ翻訳されておらず、英語で表示されています。
Meet the Lexicon
A lexicon is simply a list of words tagged with sentiment. It is the dictionary your rule-based detector will look words up in. 📖
Two Buckets to Start
Begin with two lists: positive words and negative words. Each list holds terms that reliably signal one feeling on their own.
Positive Words
Fill the positive set with words readers say when happy: good, great, love, excellent, amazing. Keep them lowercase for easy matching.
positive = {"good", "great", "love", "excellent", "amazing"}Negative Words
The negative set collects complaint words: bad, awful, hate, terrible, broken. These are the red flags your detector hunts for.
negative = {"bad", "awful", "hate", "terrible", "broken"}Why Use a Set
A Python set checks membership instantly, so testing if a word is positive stays fast even when your lists grow large.
Lowercase Everything
Great and GREAT should match the same entry, so store words lowercased and lowercase incoming text too. This keeps matching consistent.
Checking a Word
Looking a word up is one line. The in operator tells you instantly whether a term lives in your positive list.
word = "love"
is_pos = word in positiveBorrow a Ready Lexicon
You do not have to start blank. Tools like NLTK ship curated opinion lexicons with thousands of scored words you can reuse.
Watch for Overlap
A word should not sit in both lists, so keep your sets disjoint. Conflicts make scoring ambiguous and confuse your final label.
Domain Matters
Sentiment is domain-specific. For a hotel, quiet is positive; for a party, it is not. Tune the lexicon to your specific use case.
Keep It Growing
Treat your lists as living data. When the detector misses a clear cue, just add that word, so the lexicon steadily improves over time.
Quick Check
Think about why we chose this data structure.
Recap
You built a lexicon: positive and negative word sets, lowercased and disjoint, for fast lookups. You can borrow NLTK lists and tune them per domain. Next we score full reviews. ✅
よくある質問
「肯定語と否定語のリストを作る」レッスンは無料ですか?
はい。「肯定語と否定語のリストを作る」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、NLP Academyコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 NLP Academyコースには全4レッスンが含まれています。
「肯定語と否定語のリストを作る」で何を学びますか?
感情分析用の語彙集 ブラウザで直接実行するハンズオンコードでNLP Academyを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。
NLP Academyを始めるのに経験は必要ですか?
事前経験は必要ありません。CoddyKitのNLP Academyは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン2/4です。
「肯定語と否定語のリストを作る」レッスンにはどのくらい時間がかかりますか?
ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。
このNLP Academyレッスンでコードを書いて実行できますか?
はい。すべてのNLP Academyレッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。
このコースのすべてのレッスン
- 感情分析とは何か
- 肯定語と否定語のリストを作る
- 手がかりを数えてレビューをスコア化する
- 否定表現とエッジケースに対応する