Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@qrvey/text-analytics
Advanced tools
A powerful text analytics library that provides easy integration with AWS Comprehend and Azure Text Analytics for language detection, sentiment analysis, entity recognition, and key phrase extraction.
A powerful text analytics library that provides easy integration with AWS Comprehend and Azure Text Analytics for language detection, sentiment analysis, entity recognition, and key phrase extraction.
AWS_DEFAULT_REGION; //AWS Region for SQS service
AWS_ACCESS_KEY_ID; //AWS Access key for Event Bridge service
AWS_SECRET_ACCESS_KEY; //AWS Secret key for Event Bridge service
PLATFORM_TYPE; //Platform type (possible value CONTAINER)
CLOUD_PROVIDER; // Cloud service. Possible values azure, aws
You can install the @qrvey/text-analytics package via npm. Run the following command in your terminal:
npm install @qrvey/text-analytics
import TextAnalyticsServiceFactory from '@qrvey/text-analytics';
async function main() {
const textAnalyticsService = await TextAnalyticsServiceFactory.createTextAnalyticsService();
const language = await textAnalyticsService.detectLanguage('This is a sample text.');
console.log(language);
}
The TextAnalyticsService provides methods for text analysis.
Detects the dominant language of the provided text.
text: A string containing the text to analyze.
A promise that resolves to an object implementing IDetectDominantLanguageOutput.
detectLanguage(text: string): Promise<IDetectEntityOutput>
interface IDetectDominantLanguageOutput {
code: string;
score: number;
}
Detects entities in the provided text.
text: A string containing the text to analyze.
A promise that resolves to an object implementing IDetectEntityOutput.
detectEntities(text: string): Promise<IDetectEntityOutput>;
interface IDetectEntityOutput {
entities: Entity[];
}
Analyzes the sentiment of the provided text.
text: A string containing the text to analyze.
A promise that resolves to an object implementing IDetectSentimentOutput.
detectSentiment(text: string): Promise<IDetectSentimentOutput>;
interface IDetectSentimentOutput {
sentiment: string;
score: {
negative: number;
positive: number;
neutral: number;
mixed: number;
};
}
Detects key phrases in the provided text.
text: A string containing the text to analyze.
A promise that resolves to an object implementing IKeyPhraseOutput.
detectKeyPhrases(text: string): Promise<IDetectKeyPhraseOutput>;
interface IDetectKeyPhraseOutput {
keyPhrases: {
text: string;
score: number;
}[]
}
Completes a full analysis of the provided text, including language detection, entity detection, sentiment analysis, and key phrase extraction.
text: A string containing the text to analyze.
A promise that resolves to an object implementing ICompleteTextAnalysisOutput.
textAnalysisComplete(text: string): Promise<ICompleteTextAnalysisOutput>;
interface ICompleteTextAnalysisOutput {
language: IDetectDominantLanguageOutput;
entities: IDetectEntityOutput;
sentiment: IDetectSentimentOutput;
keyPhrases: IKeyPhrase[];
}
FAQs
A powerful text analytics library that provides easy integration with AWS Comprehend and Azure Text Analytics for language detection, sentiment analysis, entity recognition, and key phrase extraction.
We found that @qrvey/text-analytics demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.