私は USDA 栄養データベースを使用しており、その食品には次の説明があります。
例えば:
Cheese, fontina
Cheese, cheddar
Cheese, cottage, lowfat, 2% milkfat
Cheese, cottage, lowfat, 1% milkfat
Apples, raw, with skin
Apples, dried, sulfured, uncooked
Apples, frozen, unsweetened, heated
McDONALD'S, BIG MAC (without Big Mac Sauce)
McDONALD'S, BIG MAC
Sandwiches and burgers, roast beef sandwich with cheese
ここにはパターンがあります。エンティティを区切るためにコンマが明確に使用されています。上記の例に従うと、チーズはチェダー、コテージ、フォンティーナの親です。
このソースから情報を抽出するために、すでにいくつかの作業を行っています。私はそれを考えました:
- POS タグ付け: 単語が形容詞または動詞である場合、食品の名前の一部ではありません
- freqdist/wordcount: これは、食品の説明で単語の階層を取得するために行われました
しかし、大規模に実行すると、不正確な結果が得られます。一部の説明で POS タグ付けが失敗し、同じ文に同様の頻度の単語がある場合、freqdist/wordcount は役に立ちませんでした。
これは、取得したい結果の例です。
入力データ:
Cheese, fontina
Cheese, cheddar
Cheese, cottage, lowfat, 2% milkfat
Cheese, cottage, lowfat, 1% milkfat
出力データ:
Cheese is the parent of fontina, cottage and cheddar. lowfat is a "characteristic" cheese cottage. Cottage, cheddar and fontina are the "principal foods".
入力データ:
Sandwiches and burgers, roast beef sandwich with cheese
出力データ:
Cheese is a characteristic of roast beef sandwich. The category of the food is sandwiches and burgers and the "principal food" is roast beef sandwich.
初心者なので色々と教えていただきたいです。NLP には多くの情報があり、その主題について幅広い知識がないと、どの道を進むべきかを判断するのは困難です。