Example #1
0
        public void AnalyzeDocument()
        {
            //arrange
            var doc = new DocumentRequest
            {
                id = "2d2e7341-a3c2-4fb4-9d3a-779e8b0a5eff",
                //2049
                text = "The drive for ever-greater institutional efficiency places an enormous burden on those involved in developing regulatory submissions. Jim Reilly suggests how this process can be engineered to function more effectively and meet the organisation's demands. Jim Reilly is a consultant, software implementation, for development partnering organisation Octagon Research Solutions Inc. He is based at the company's headquarters in Wayne, Pennsylvania, in the US. Email: [email protected] The pharmaceutical industry has been cast into the storm of the digital age in recent years. It is possible to walk around any pharma company and hear whispers of gene sequencing, predictive animal modelling, electronic data capture, XML authoring or the electronic common technical document. All of these are relatively new developments and form part of a trend towards the ever-elusive concept of institutional efficiency. It is clear that everyone wishes to do things better, smarter and faster. Those of us involved on the regulatory front have not turned a blind eye to this drive towards efficiency. Whether it be adverse event reporting (AERS in the US or EUDRAVigilance in the European Union), clinical trial applications/investigational new drug applications or marketing applications, we are confronted with a host of electronic means to submit data. The recent trend has been towards submitting data simultaneously across the globe. After all, what more efficient way is there to submit similar material than at the same time? Thanks to the advent of the common technical document, authors can pen the story of the safety, efficacy and quality of their therapeutic in a standard way. Gone are the days of writing similar content in alternative formats, or retrofitting information for a different purpose. In the drive towards commonality of review content amongst global regulatory agencies, regulatory groups in pharma have begun focusing their efficiency efforts towards simultaneous global submissions. For the first time, a marketing author"
            };

            //act
            var responseId = _sut.SendDocument(doc);

            var result = new DocumentAnalysis {
                status = ""
            };

            while (result.status.ToLower() != "processed")
            {
                System.Threading.Thread.Sleep(5000);
                result = _sut.GetDocument(doc.id);
            }

            //assert
            Assert.IsNotNull(result.summary.Length > 0);
        }
        protected override void Analyze(PythonAst ast, int version)
        {
            NotifyAnalysisBegins();
            var walker   = Analyze(ast);
            var analysis = new DocumentAnalysis(this, version, walker.GlobalScope, walker.Eval, walker.StarImportMemberNames);

            NotifyAnalysisComplete(analysis);
        }
        public async Task Get_Sentiment_Analysis_Results_Using_TypedHttpClient()
        {
            var document1 = new Document {
                Id = "1", Text = "This is a really negative tweet", Language = "en-gb"
            };
            var document2 = new Document {
                Id = "2", Text = "This is a super positive great tweet", Language = "en-gb"
            };
            var document3 = new Document {
                Id = "3", Text = "This is another really super positive amazing tweet", Language = "en-gb"
            };

            var result1 = new DocumentAnalysis {
                Id = "1", Score = 0
            };
            var result2 = new DocumentAnalysis {
                Id = "2", Score = 0.7
            };
            var result3 = new DocumentAnalysis {
                Id = "3", Score = 0.9
            };

            var documents = new List <Document> {
                document1, document2, document3
            };
            var results = new AnalysisResult {
                Documents = new List <DocumentAnalysis> {
                    result1, result2, result3
                }
            };

            var fakeConfiguration = Substitute.For <IConfiguration>();

            var fakeHttpMessageHandler = new FakeHttpMessageHandler(new HttpResponseMessage()
            {
                StatusCode = HttpStatusCode.OK,
                Content    = new StringContent(JsonConvert.SerializeObject(results), Encoding.UTF8, "application/json")
            });

            var fakeHttpClient = new HttpClient(fakeHttpMessageHandler);

            var sut = new TextAnalyticsClient(fakeConfiguration, fakeHttpClient);

            var result = await sut.AnalyzeSentiment(documents);

            result.Documents.Count.ShouldBe(3);
            result.Documents.ShouldContain(f => f.Id == result1.Id && f.Score == result1.Score);
        }
Example #4
0
 public static string ToNavigationPath()
 {
     return(DocumentAnalysis.ToNavigationPath() + "/" + Key);
 }