Cybercrux

Everything is achievable through technology

Grobid

How to use Grobid in Microsoft project


private async Task InvokeGroBidAPI()
{
try
{
Stream fileStream = System.IO.File.OpenRead(@"C:\3.pdf");
HttpContent fileStreamContent = new StreamContent(fileStream);
using (var client = new HttpClient())
using (var formData = new MultipartFormDataContent())
{
formData.Add(fileStreamContent, "input", "input");
var response = await client.PostAsync("http://localhost:8070/api/processFulltextDocument", formData);
if (!response.IsSuccessStatusCode)
{
return null;
}
var contents = await response.Content.ReadAsStringAsync();
return contents;
}
}
catch (WebException exception)
{

throw exception;
}
}

Advertisements