Earnings Call Sentiment Analysis Tool

Earnings Call Sentiment Analysis Tool

Input Earnings Call Transcript

Paste the text of an earnings call transcript below. The tool will analyze its sentiment using a simplified, rule-based approach based on a predefined lexicon of financial terms.

Sentiment Score: ${sentimentScoreSpan.textContent}

`; pdfHtmlContent += `

Assessment: ${sentimentAssessmentSpan.textContent.replace('Assessment: ', '')}

`; // Add Sentiment Breakdown Table pdfHtmlContent += `

Sentiment Breakdown:

`; pdfHtmlContent += ``; pdfHtmlContent += ``; pdfHtmlContent += ``; pdfHtmlContent += ``; pdfHtmlContent += ``; pdfHtmlContent += `
CategoryKeywords Count
Positive${positiveCountSpan.textContent}
Negative${negativeCountSpan.textContent}
Neutral/Uncertainty${neutralCountSpan.textContent}
Total Analyzed Keywords${totalAnalyzedCountSpan.textContent}
`; pdfRenderContainer.innerHTML = pdfHtmlContent; try { const canvas = await html2canvas(pdfRenderContainer, { useCORS: true, scale: 2, logging: false }); const imgData = canvas.toDataURL('image/png'); const pdf = new jsPDF('p', 'mm', 'a4'); const imgWidth = 210; const pageHeight = 297; const imgHeight = canvas.height * imgWidth / canvas.width; let heightLeft = imgHeight; let position = 0; pdf.addImage(imgData, 'PNG', 0, position, imgWidth, imgHeight); heightLeft -= pageHeight; while (heightLeft >= 0) { position = heightLeft - imgHeight; pdf.addPage(); pdf.addImage(imgData, 'PNG', 0, position, imgWidth, imgHeight); heightLeft -= pageHeight; } pdf.save('earnings_call_sentiment_report.pdf'); } catch (error) { console.error('Error generating PDF:', error); alertUser('Failed to generate PDF. Please try again or check console for errors.'); } finally { pdfRenderContainer.innerHTML = ''; } }); // --- Custom Alert Function --- function alertUser(message) { let msgBox = document.getElementById('user-message-box'); let messageTextSpan; let closeButton; if (!msgBox) { msgBox = document.createElement('div'); msgBox.id = 'user-message-box'; msgBox.className = 'fixed inset-x-0 top-0 flex items-center justify-center p-4 z-50'; msgBox.innerHTML = ` `; document.body.appendChild(msgBox); // Now query within msgBox, after it's in the DOM messageTextSpan = msgBox.querySelector('#user-message-text'); closeButton = msgBox.querySelector('#close-user-message'); closeButton.addEventListener('click', () => { msgBox.classList.add('hidden'); }); } else { // If msgBox already exists, just get references to its children messageTextSpan = msgBox.querySelector('#user-message-text'); closeButton = msgBox.querySelector('#close-user-message'); } messageTextSpan.innerHTML = message; // Use innerHTML to allow line breaks msgBox.classList.remove('hidden'); setTimeout(() => { msgBox.classList.add('hidden'); }, 5000); } });
Scroll to Top