All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edu.utah.bmi.nlp.context.common.ConTextAdvancedInterface Maven / Gradle / Ivy

Go to download

FastContext is an optimized Java implementation of ConText algorithm (https://www.ncbi.nlm.nih.gov/pubmed/23920642). It runs two orders of magnitude faster than previous two popular implementations: JavaConText and GeneralConText. Version 2.0 includes UIMA wrapper

The newest version!
/*
 * ******************************************************************************
 *  * Copyright  2017  Department of Biomedical Informatics, University of Utah
 *  * 

* * Licensed under the Apache License, Version 2.0 (the "License"); * * you may not use this file except in compliance with the License. * * You may obtain a copy of the License at * *

* * http://www.apache.org/licenses/LICENSE-2.0 * *

* * Unless required by applicable law or agreed to in writing, software * * distributed under the License is distributed on an "AS IS" BASIS, * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * * See the License for the specific language governing permissions and * * limitations under the License. * ****************************************************************************** */ package edu.utah.bmi.nlp.context.common; import edu.utah.bmi.nlp.core.Span; import java.util.ArrayList; import java.util.LinkedHashMap; /** *

* This is an extended ConText interface class, which defines two additional interface methods that reserve the evidence Span information for Assertions. * This interface is optional. Because for most of use cases, storing evidence information is not necessary. *

* * @author Jianlin Shi on 6/24/15. */ public interface ConTextAdvancedInterface extends ConTextBasicInterface { /** * This interface method has the same input as processContext in ConTextInterface, but return a LinkedHashMap with Assertions as the keys, * and Spans as the values. * * @param tokens A list of tokens in an ArrayList of String format * @param conceptStartPosition The start position of concept in the token ArrayList (start from 0) * @param conceptEndPosition The end position of a concept in the token ArrayList * @param windowsize The window size that need to be consider for the match (FastContext doesn't use window size * here, instead it evaluate the window boundary defined in each matched rule--more flexible. * @return Matched context rules in LinkedHashMap format, where the key is the rule name, and the key * is the matched span */ LinkedHashMap processContextWEvidence(ArrayList tokens, int conceptStartPosition, int conceptEndPosition, int windowsize); /** * This interface method has the same input as processContext in ConTextInterface, but return a LinkedHashMap with Assertions as the keys, * and Spans as the values. * * @param tokens A list of tokens in an ArrayList of Span format * @param conceptStartPosition The start position of concept in the token ArrayList (start from 0) * @param conceptEndPosition The end position of a concept in the token ArrayList * @param windowsize The window size that need to be consider for the match (FastContext doesn't use window size * here, instead it evaluate the window boundary defined in each matched rule--more flexible. * @param text The text string of which the spans' offsets come from * @return Matched context rules in LinkedHashMap format, where the key is the rule name, and the key * is the matched span */ LinkedHashMap processContextWEvidence(ArrayList tokens, int conceptStartPosition, int conceptEndPosition, String text, int windowsize); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy