Library

Dow Jones Companies

« Back to Library

Item typeClassifier
Version1
Filter Hash 8a4fbc04772c80b9d3da7fe5cf94f28e Copy

This classifier demonstrates how you can use tags to identify companies being mentioned in conversations - in this case within the Dow Jones Industrial Average.

A common task is to track or analyze conversations relating to companies. For instance you may want to monitor conversations relating to you and your competitors and gauge relative sentiment. This example demonstrates how you can pick out companies mentioned in conversation, tag posts appropriately and more easily process the results in your application.

The classifier inspects post content for mentions of company names, common abbreviations and stock symbols for companies listed in the Dow Jones Industrial Average.

Notes:

The example tag set covers companies on the Dow Jones index only. You can extend or modify this example to suit your use case.

Definition

// scores (name and ticker)
tag.dow_jones.score +1 { interaction.content contains_any "Procter & Gamble Company,Procter and Gamble Company,Procter & Gamble Co,Procter and Gamble Co" }
tag.dow_jones.score +1 { interaction.content contains_any "Johnson & Johnson,Johnson and Johnson" }
tag.dow_jones.score +1 { interaction.content contains_any "Nike Incorporated,Nike Inc" }
tag.dow_jones.score +1 { interaction.content contains_any "Walt Disney Company,Walt Disney Co" }
tag.dow_jones.score +1 { interaction.content contains_any "Wal-Mart Stores Incorporated,Wal-Mart Stores Inc" }
tag.dow_jones.score +1 { interaction.content contains_any "Exxon Mobil Corp,Exxon Mobil Corporation" }
tag.dow_jones.score +1 { interaction.content contains_any "Coca-Cola Company,Coca-Cola Co" }
tag.dow_jones.score +1 { interaction.content contains_any "Boeing Company,Boeing Co" }
tag.dow_jones.score +1 { interaction.content contains_any "United Technologies Corporation,United Technologies Corp" }
tag.dow_jones.score +1 { interaction.content contains_any "Intel Corp,Intel Corporation" }
tag.dow_jones.score +1 { interaction.content contains_any "AT&T Incorporated,AT&T Inc" }
tag.dow_jones.score +1 { interaction.content contains_any "JPMorgan Chase and Co,JPMorgan Chase & Co,JPMorgan Chase and Company,JPMorgan Chase & Company" }
tag.dow_jones.score +1 { interaction.content contains_any "Goldman Sachs Group Inc,Goldman Sachs Group Incorporated" }
tag.dow_jones.score +1 { interaction.content contains_any "Home Depot Incorporated,Home Depot Inc" }
tag.dow_jones.score +1 { interaction.content contains_any "Cisco Systems Incorporated,Cisco Systems Inc" }
tag.dow_jones.score +1 { interaction.content contains_any "McDonald's Corp,McDonald's Corporation" }
tag.dow_jones.score +1 { interaction.content contains_any "Verizon Communications Inc,Verizon Communications Incorporated" }
tag.dow_jones.score +1 { interaction.content contains_any "American Express Company,American Express Co" }
tag.dow_jones.score +1 { interaction.content contains_any "Visa Incorporated,Visa Inc" }
tag.dow_jones.score +1 { interaction.content contains_any "International Business Machines Corporation,International Business Machines Corp" }
tag.dow_jones.score +1 { interaction.content contains_any "Pfizer Inc,Pfizer Incorporated" }
tag.dow_jones.score +1 { interaction.content contains_any "Microsoft Corp,Microsoft Corporation" }
tag.dow_jones.score +1 { interaction.content contains_any "Travelers Companies Incorporated,Travelers Companies Inc" }
tag.dow_jones.score +1 { interaction.content contains_any "Caterpillar Incorporated,Caterpillar Inc" }
tag.dow_jones.score +1 { interaction.content contains_any "3M Company,3M Co" }
tag.dow_jones.score +1 { interaction.content contains_any "General Electric Company,General Electric Co" }
tag.dow_jones.score +1 { interaction.content contains_any "E. I. du Pont de Nemours & Co,E I du Pont de Nemours and Company,E. I. du Pont de Nemours & Company,E. I. du Pont de Nemours and Co,E. I. du Pont de Nemours and Company,E I du Pont de Nemours and Co,E I du Pont de Nemours & Company" }
tag.dow_jones.score +1 { interaction.content contains_any "UnitedHealth Group Incorporated,UnitedHealth Group Inc" }
tag.dow_jones.score +1 { interaction.content contains_any "Chevron Corporation,Chevron Corp" }
tag.dow_jones.score +1 { interaction.content contains_any "Merck and Co Inc,Merck and Co. Incorporated,Merck and Co. Inc,Merck & Company Incorporated,Merck and Company Inc,Merck & Co Incorporated,Merck & Co Inc,Merck & Co. Incorporated,Merck & Company Inc,Merck & Co. Inc" }

tag.dow_jones.score +1 { interaction.content contains_any "$PG" }
tag.dow_jones.score +1 { interaction.content contains_any "$JNJ" }
tag.dow_jones.score +1 { interaction.content contains_any "$NKE" }
tag.dow_jones.score +1 { interaction.content contains_any "$DIS" }
tag.dow_jones.score +1 { interaction.content contains_any "$WMT" }
tag.dow_jones.score +1 { interaction.content contains_any "$XOM" }
tag.dow_jones.score +1 { interaction.content contains_any "$KO" }
tag.dow_jones.score +1 { interaction.content contains_any "$BA" }
tag.dow_jones.score +1 { interaction.content contains_any "$UTX" }
tag.dow_jones.score +1 { interaction.content contains_any "$INTC" }
tag.dow_jones.score +1 { interaction.content contains_any "$T" }
tag.dow_jones.score +1 { interaction.content contains_any "$JPM" }
tag.dow_jones.score +1 { interaction.content contains_any "$GS" }
tag.dow_jones.score +1 { interaction.content contains_any "$HD" }
tag.dow_jones.score +1 { interaction.content contains_any "$CSCO" }
tag.dow_jones.score +1 { interaction.content contains_any "$MCD" }
tag.dow_jones.score +1 { interaction.content contains_any "$VZ" }
tag.dow_jones.score +1 { interaction.content contains_any "$AXP" }
tag.dow_jones.score +1 { interaction.content contains_any "$V" }
tag.dow_jones.score +1 { interaction.content contains_any "$IBM" }
tag.dow_jones.score +1 { interaction.content contains_any "$PFE" }
tag.dow_jones.score +1 { interaction.content contains_any "$MSFT" }
tag.dow_jones.score +1 { interaction.content contains_any "$TRV" }
tag.dow_jones.score +1 { interaction.content contains_any "$CAT" }
tag.dow_jones.score +1 { interaction.content contains_any "$MMM" }
tag.dow_jones.score +1 { interaction.content contains_any "$GE" }
tag.dow_jones.score +1 { interaction.content contains_any "$DD" }
tag.dow_jones.score +1 { interaction.content contains_any "$UNH" }
tag.dow_jones.score +1 { interaction.content contains_any "$CVX" }
tag.dow_jones.score +1 { interaction.content contains_any "$MRK" }

// company names
tag.dow_jones.company_name "Procter & Gamble Company" { interaction.content contains_any "Procter & Gamble Company,Procter and Gamble Company,Procter & Gamble Co,Procter and Gamble Co,$PG" }
tag.dow_jones.company_name "Johnson & Johnson" { interaction.content contains_any "Johnson & Johnson,Johnson and Johnson,$JNJ" }
tag.dow_jones.company_name "Nike Inc" { interaction.content contains_any "Nike Incorporated,Nike Inc,$NKE" }
tag.dow_jones.company_name "Walt Disney Company" { interaction.content contains_any "Walt Disney Company,Walt Disney Co,$DIS" }
tag.dow_jones.company_name "Wal-Mart Stores Inc" { interaction.content contains_any "Wal-Mart Stores Incorporated,Wal-Mart Stores Inc,$WMT" }
tag.dow_jones.company_name "Exxon Mobil Corporation" { interaction.content contains_any "Exxon Mobil Corp,Exxon Mobil Corporation,$XOM" }
tag.dow_jones.company_name "Coca-Cola Company" { interaction.content contains_any "Coca-Cola Company,Coca-Cola Co,$KO" }
tag.dow_jones.company_name "Boeing Company" { interaction.content contains_any "Boeing Company,Boeing Co,$BA" }
tag.dow_jones.company_name "United Technologies Corp" { interaction.content contains_any "United Technologies Corporation,United Technologies Corp,$UTX" }
tag.dow_jones.company_name "Intel Corporation" { interaction.content contains_any "Intel Corp,Intel Corporation,$INTC" }
tag.dow_jones.company_name "AT&T Inc" { interaction.content contains_any "AT&T Incorporated,AT&T Inc,$T" }
tag.dow_jones.company_name "JPMorgan Chase & Co" { interaction.content contains_any "JPMorgan Chase and Co,JPMorgan Chase & Co,JPMorgan Chase and Company,JPMorgan Chase & Company,$JPM" }
tag.dow_jones.company_name "Goldman Sachs Group Inc" { interaction.content contains_any "Goldman Sachs Group Inc,Goldman Sachs Group Incorporated,$GS" }
tag.dow_jones.company_name "Home Depot Inc" { interaction.content contains_any "Home Depot Incorporated,Home Depot Inc,$HD" }
tag.dow_jones.company_name "Cisco Systems Inc" { interaction.content contains_any "Cisco Systems Incorporated,Cisco Systems Inc,$CSCO" }
tag.dow_jones.company_name "McDonald's Corp" { interaction.content contains_any "McDonald's Corp,McDonald's Corporation,$MCD" }
tag.dow_jones.company_name "Verizon Communications Inc" { interaction.content contains_any "Verizon Communications Inc,Verizon Communications Incorporated,$VZ" }
tag.dow_jones.company_name "American Express Company" { interaction.content contains_any "American Express Company,American Express Co,$AXP" }
tag.dow_jones.company_name "Visa Inc" { interaction.content contains_any "Visa Incorporated,Visa Inc,$V" }
tag.dow_jones.company_name "International Business Machines Corporation" { interaction.content contains_any "International Business Machines Corporation,International Business Machines Corp,$IBM" }
tag.dow_jones.company_name "Pfizer Inc" { interaction.content contains_any "Pfizer Inc,Pfizer Incorporated,$PFE" }
tag.dow_jones.company_name "Microsoft Corporation" { interaction.content contains_any "Microsoft Corp,Microsoft Corporation,$MSFT" }
tag.dow_jones.company_name "Travelers Companies Inc" { interaction.content contains_any "Travelers Companies Incorporated,Travelers Companies Inc,$TRV" }
tag.dow_jones.company_name "Caterpillar Inc" { interaction.content contains_any "Caterpillar Incorporated,Caterpillar Inc,$CAT" }
tag.dow_jones.company_name "3M Company" { interaction.content contains_any "3M Company,3M Co,$MMM" }
tag.dow_jones.company_name "General Electric Company" { interaction.content contains_any "General Electric Company,General Electric Co,$GE" }
tag.dow_jones.company_name "E. I. du Pont de Nemours and Company" { interaction.content contains_any "E. I. du Pont de Nemours & Co,E I du Pont de Nemours and Company,E. I. du Pont de Nemours & Company,E. I. du Pont de Nemours and Co,E. I. du Pont de Nemours and Company,E I du Pont de Nemours and Co,E I du Pont de Nemours & Company,$DD" }
tag.dow_jones.company_name "UnitedHealth Group Incorporated" { interaction.content contains_any "UnitedHealth Group Incorporated,UnitedHealth Group Inc,$UNH" }
tag.dow_jones.company_name "Chevron Corporation" { interaction.content contains_any "Chevron Corporation,Chevron Corp,$CVX" }
tag.dow_jones.company_name "Merck & Co. Inc" { interaction.content contains_any "Merck and Co Inc,Merck and Co. Incorporated,Merck and Co. Inc,Merck & Company Incorporated,Merck and Company Inc,Merck & Co Incorporated,Merck & Co Inc,Merck & Co. Incorporated,Merck & Company Inc,Merck & Co. Inc,$MRK" }

// stock symbols
tag.dow_jones.stock_symbol "PG" { interaction.content contains_any "Procter & Gamble Company,Procter and Gamble Company,Procter & Gamble Co,Procter and Gamble Co,$PG" }
tag.dow_jones.stock_symbol "JNJ" { interaction.content contains_any "Johnson & Johnson,Johnson and Johnson,$JNJ" }
tag.dow_jones.stock_symbol "NKE" { interaction.content contains_any "Nike Incorporated,Nike Inc,$NKE" }
tag.dow_jones.stock_symbol "DIS" { interaction.content contains_any "Walt Disney Company,Walt Disney Co,$DIS" }
tag.dow_jones.stock_symbol "WMT" { interaction.content contains_any "Wal-Mart Stores Incorporated,Wal-Mart Stores Inc,$WMT" }
tag.dow_jones.stock_symbol "XOM" { interaction.content contains_any "Exxon Mobil Corp,Exxon Mobil Corporation,$XOM" }
tag.dow_jones.stock_symbol "KO" { interaction.content contains_any "Coca-Cola Company,Coca-Cola Co,$KO" }
tag.dow_jones.stock_symbol "BA" { interaction.content contains_any "Boeing Company,Boeing Co,$BA" }
tag.dow_jones.stock_symbol "UTX" { interaction.content contains_any "United Technologies Corporation,United Technologies Corp,$UTX" }
tag.dow_jones.stock_symbol "INTC" { interaction.content contains_any "Intel Corp,Intel Corporation,$INTC" }
tag.dow_jones.stock_symbol "T" { interaction.content contains_any "AT&T Incorporated,AT&T Inc,$T" }
tag.dow_jones.stock_symbol "JPM" { interaction.content contains_any "JPMorgan Chase and Co,JPMorgan Chase & Co,JPMorgan Chase and Company,JPMorgan Chase & Company,$JPM" }
tag.dow_jones.stock_symbol "GS" { interaction.content contains_any "Goldman Sachs Group Inc,Goldman Sachs Group Incorporated,$GS" }
tag.dow_jones.stock_symbol "HD" { interaction.content contains_any "Home Depot Incorporated,Home Depot Inc,$HD" }
tag.dow_jones.stock_symbol "CSCO" { interaction.content contains_any "Cisco Systems Incorporated,Cisco Systems Inc,$CSCO" }
tag.dow_jones.stock_symbol "MCD" { interaction.content contains_any "McDonald's Corp,McDonald's Corporation,$MCD" }
tag.dow_jones.stock_symbol "VZ" { interaction.content contains_any "Verizon Communications Inc,Verizon Communications Incorporated,$VZ" }
tag.dow_jones.stock_symbol "AXP" { interaction.content contains_any "American Express Company,American Express Co,$AXP" }
tag.dow_jones.stock_symbol "V" { interaction.content contains_any "Visa Incorporated,Visa Inc,$V" }
tag.dow_jones.stock_symbol "IBM" { interaction.content contains_any "International Business Machines Corporation,International Business Machines Corp,$IBM" }
tag.dow_jones.stock_symbol "PFE" { interaction.content contains_any "Pfizer Inc,Pfizer Incorporated,$PFE" }
tag.dow_jones.stock_symbol "MSFT" { interaction.content contains_any "Microsoft Corp,Microsoft Corporation,$MSFT" }
tag.dow_jones.stock_symbol "TRV" { interaction.content contains_any "Travelers Companies Incorporated,Travelers Companies Inc,$TRV" }
tag.dow_jones.stock_symbol "CAT" { interaction.content contains_any "Caterpillar Incorporated,Caterpillar Inc,$CAT" }
tag.dow_jones.stock_symbol "MMM" { interaction.content contains_any "3M Company,3M Co,$MMM" }
tag.dow_jones.stock_symbol "GE" { interaction.content contains_any "General Electric Company,General Electric Co,$GE" }
tag.dow_jones.stock_symbol "DD" { interaction.content contains_any "E. I. du Pont de Nemours & Co,E I du Pont de Nemours and Company,E. I. du Pont de Nemours & Company,E. I. du Pont de Nemours and Co,E. I. du Pont de Nemours and Company,E I du Pont de Nemours and Co,E I du Pont de Nemours & Company,$DD" }
tag.dow_jones.stock_symbol "UNH" { interaction.content contains_any "UnitedHealth Group Incorporated,UnitedHealth Group Inc,$UNH" }
tag.dow_jones.stock_symbol "CVX" { interaction.content contains_any "Chevron Corporation,Chevron Corp,$CVX" }
tag.dow_jones.stock_symbol "MRK" { interaction.content contains_any "Merck and Co Inc,Merck and Co. Incorporated,Merck and Co. Inc,Merck & Company Incorporated,Merck and Company Inc,Merck & Co Incorporated,Merck & Co Inc,Merck & Co. Incorporated,Merck & Company Inc,Merck & Co. Inc,$MRK" }


// objects found
tag.dow_jones.found "stock_symbol" { interaction.content contains_any "$PG,$JNJ,$NKE,$DIS,$WMT,$XOM,$KO,$BA,$UTX,$INTC,$T,$JPM,$GS,$HD,$CSCO,$MCD,$VZ,$AXP,$V,$IBM,$PFE,$MSFT,$TRV,$CAT,$MMM,$GE,$DD,$UNH,$CVX,$MRK" }
tag.dow_jones.found "company_name" { interaction.content contains_any "Procter & Gamble Company,Procter and Gamble Company,Procter & Gamble Co,Procter and Gamble Co,Johnson & Johnson,Johnson and Johnson,Nike Incorporated,Nike Inc,Walt Disney Company,Walt Disney Co,Wal-Mart Stores Incorporated,Wal-Mart Stores Inc,Exxon Mobil Corp,Exxon Mobil Corporation,Coca-Cola Company,Coca-Cola Co,Boeing Company,Boeing Co,United Technologies Corporation,United Technologies Corp,Intel Corp,Intel Corporation,AT&T Incorporated,AT&T Inc,JPMorgan Chase and Co,JPMorgan Chase & Co,JPMorgan Chase and Company,JPMorgan Chase & Company,Goldman Sachs Group Inc,Goldman Sachs Group Incorporated,Home Depot Incorporated,Home Depot Inc,Cisco Systems Incorporated,Cisco Systems Inc,McDonald's Corp,McDonald's Corporation,Verizon Communications Inc,Verizon Communications Incorporated,American Express Company,American Express Co,Visa Incorporated,Visa Inc,International Business Machines Corporation,International Business Machines Corp,Pfizer Inc,Pfizer Incorporated,Microsoft Corp,Microsoft Corporation,Travelers Companies Incorporated,Travelers Companies Inc,Caterpillar Incorporated,Caterpillar Inc,3M Company,3M Co,General Electric Company,General Electric Co,E. I. du Pont de Nemours & Co,E I du Pont de Nemours and Company,E. I. du Pont de Nemours & Company,E. I. du Pont de Nemours and Co,E. I. du Pont de Nemours and Company,E I du Pont de Nemours and Co,E I du Pont de Nemours & Company,UnitedHealth Group Incorporated,UnitedHealth Group Inc,Chevron Corporation,Chevron Corp,Merck and Co Inc,Merck and Co. Incorporated,Merck and Co. Inc,Merck & Company Incorporated,Merck and Company Inc,Merck & Co Incorporated,Merck & Co Inc,Merck & Co. Incorporated,Merck & Company Inc,Merck & Co. Inc" }
// Library item "Dow Jones Companies" version 1
tags "8a4fbc04772c80b9d3da7fe5cf94f28e"

return {

    interaction.content contains_any "Procter & Gamble Company,Procter and Gamble Company,Procter & Gamble Co,Procter and Gamble Co,$PG,Johnson & Johnson,Johnson and Johnson,$JNJ,Nike Incorporated,Nike Inc,$NKE,Walt Disney Company,Walt Disney Co,$DIS,Wal-Mart Stores Incorporated,Wal-Mart Stores Inc,$WMT,Exxon Mobil Corp,Exxon Mobil Corporation,$XOM,Coca-Cola Company,Coca-Cola Co,$KO,Boeing Company,Boeing Co,$BA,United Technologies Corporation,United Technologies Corp,$UTX,Intel Corp,Intel Corporation,$INTC,AT&T Incorporated,AT&T Inc,$T,JPMorgan Chase and Co,JPMorgan Chase & Co,JPMorgan Chase and Company,JPMorgan Chase & Company,$JPM,Goldman Sachs Group Inc,Goldman Sachs Group Incorporated,$GS,Home Depot Incorporated,Home Depot Inc,$HD,Cisco Systems Incorporated,Cisco Systems Inc,$CSCO,McDonald's Corp,McDonald's Corporation,$MCD,Verizon Communications Inc,Verizon Communications Incorporated,$VZ,American Express Company,American Express Co,$AXP,Visa Incorporated,Visa Inc,$V,International Business Machines Corporation,International Business Machines Corp,$IBM,Pfizer Inc,Pfizer Incorporated,$PFE,Microsoft Corp,Microsoft Corporation,$MSFT,Travelers Companies Incorporated,Travelers Companies Inc,$TRV,Caterpillar Incorporated,Caterpillar Inc,$CAT,3M Company,3M Co,$MMM,General Electric Company,General Electric Co,$GE,E. I. du Pont de Nemours & Co,E I du Pont de Nemours and Company,E. I. du Pont de Nemours & Company,E. I. du Pont de Nemours and Co,E. I. du Pont de Nemours and Company,E I du Pont de Nemours and Co,E I du Pont de Nemours & Company,$DD,UnitedHealth Group Incorporated,UnitedHealth Group Inc,$UNH,Chevron Corporation,Chevron Corp,$CVX,Merck and Co Inc,Merck and Co. Incorporated,Merck and Co. Inc,Merck & Company Incorporated,Merck and Company Inc,Merck & Co Incorporated,Merck & Co Inc,Merck & Co. Incorporated,Merck & Company Inc,Merck & Co. Inc,$MRK"
}