AI-Powered Keyword Extraction for .NET Applications
π― Purpose of the Sample
This Keyword Extraction Demo demonstrates how to leverage the LM-Kit.NET SDK to identify and extract the most relevant keywords or key phrases from various text sources. This capability is useful in scenarios such as large-scale content analysis, search optimization, topic identification, and enhanced content curation. By deploying LM-Kit's high-performance, on-device keyword extraction technology, developers can quickly and accurately filter through extensive documents to surface critical insights.
The demo uses the KeywordExtraction
class, which provides a simple, high-level API for extracting top keywords. It also harnesses LM-Kit's Dynamic Sampling technology to achieve fast, accurate results, even on smaller models.
π₯ Industry Target Audience
The Keyword Extraction sample is especially valuable for developers and organizations working in fields that need rapid insight into large textual datasets:
- π Content Management: Automatically uncover key topics in articles, reports, and other unstructured text, improving categorization and indexing.
- π Search & Discovery: Enhance internal search engines, knowledge bases, and question-answering systems with more focused keyword filters.
- π Market & Competitive Intelligence: Quickly identify recurring themes in news articles, research reports, or social media feeds.
- π¨βπΌ Human Resources & Recruiting: Identify major skill keywords from candidate resumes, job descriptions, and HR documents.
- ποΈ Legal & Compliance: Pinpoint essential legal terms or clauses in large collections of contracts and regulatory documents.
- π Analytics & Business Intelligence: Distill large textual datasets into actionable insights, guiding data-driven decision-making.
π Problem Solved
Manually sifting through large volumes of text to identify key topics and terms is both time-consuming and prone to human error. By using LM-Kitβs on-device keyword extraction, this demo streamlines the process, automatically surfacing critical keywords with speed and accuracy. Whether you need to quickly understand main themes in a large report, enhance the relevance of search queries, or inform downstream analytics and recommendations, this solution drastically reduces overhead and increases reliability.
π» Sample Application Description
The Keyword Extraction Demo is a console application that allows users to input a text file containing a passage of interest. The application then runs the LM-Kit keyword extraction engine on the text, identifying and returning the top keywords. This entire process is facilitated by the KeywordExtraction
class, simplifying the logic required and offering a high-level API to configure parameters like the number of keywords to extract.
The result is a concise list of keywords that capture the essence of the document, which can then be used in search optimization, content summarization, recommendation systems, or any scenario where understanding the main topics quickly is valuable.
β¨ Key Features
- π§ Model Flexibility: Choose from multiple pre-trained models or specify custom ones.
- π Wide Application: Efficiently extract key terms from any text sourceβarticles, documents, reports, emails, etc.
- π High-Level API: Simplified integration using the
KeywordExtraction
class. - β‘ Dynamic Sampling: Utilizes Dynamic Sampling technology for quick, accurate keyword results.
- 𧩠On-Device Efficiency: No external services needed, ensuring privacy and reduced latency.
π§ Supported Models
This sample supports the same set of pre-trained models as other LM-Kit samples, including:
- Mistral Nemo 2407 12.2B
- Meta Llama 3.1 8B
- Google Gemma2 9B Medium
- Microsoft Phi-3 3.82B Mini
- Alibaba Qwen-2 7.6B
- Additional smaller models or custom model URIs as desired
π οΈ Getting Started
π Prerequisites
- .NET Framework 4.6.2 or .NET 6.0
π₯ Download the Project
βΆοΈ Running the Application
π Clone the repository:
git clone https://github.com/LM-Kit/lm-kit-net-samples.git
π Navigate to the project directory:
cd lm-kit-net-samples/console_net6/keyword_extraction
or
cd lm-kit-net-samples/console_framework_4.62/keyword_extraction
π¨ Build and run the application:
dotnet build dotnet run
π‘ Example Usage
Set the License Key (if available):
LMKit.Licensing.LicenseManager.SetLicenseKey(""); // Set an optional license key if available.
Select the Model: Upon running, the application will prompt you to select from the pre-defined models or input a custom model URI.
Provide the Input Text File: The application will request the path to a text file from which to extract keywords. For example:
Please enter the path to the text file containing your input: > path/to/your/textfile.txt
View the Extracted Keywords: After processing, the application will display the top extracted keywords along with timing and confidence metrics:
Extracted elements: keyword1 keyword2 ... Extraction done in X.XX seconds | Confidence: YY
By following these steps, developers can effortlessly experiment with keyword extraction on their own data, rapidly identifying main topics and key phrases. This streamlined approach to keyword identification can be integrated into various workflows, ranging from search enhancement and topic discovery to providing more personalized user experiences.