Although you can certainly clone this repo and build your own binaries, it's also possible to use a pre-compiled version from NuGet by following these steps:
-
In Visual Studio, from the Tools menu select Library Package Manager and then click Package Manager Console.
-
In the Package Manager Console window that is displayed simply type:
install-package Smartlogic.Semaphore.Api
and you're done!
For more info see Smartlogic.Semaphore.Api on NuGet
using System;
using System.Collections.Generic;
using System.IO;
using Smartlogic.Semaphore.Api;
namespace APIDemo
{
internal class Program
{
private static void Main(string[] args)
{
var client = new ClassificationServer(new Uri("http://your-classification-server-url"));
var doc = File.ReadAllBytes(@"C:\path\to\somedocument.pdf");
var options = new ClassificationOptions
{
Threshold = 10
};
var metadata = new Dictionary<string, string>();
var result = client.Classify("My File", doc, "filename.pdf", metadata, "", options);
var classifications = result.GetClassifications();
Console.WriteLine("Results:-");
foreach (var item in classifications)
{
Console.WriteLine($"{item.ClassName} {item.Id} {item.Score} {item.Value}");
}
Console.ReadLine();
}
}
}