This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.github.h4ste.umls; | |
import com.google.common.collect.ImmutableSet; | |
import java.util.Set; | |
/** | |
* These stopwords and semantic categories are from Dina Demner-Fushman | |
*/ | |
@SuppressWarnings({"unused", "SpellCheckingInspection"}) | |
public final class UmlsConstants { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import division | |
from collections import Counter | |
import numpy as np | |
from six import iterkeys | |
def truncate_outputs(outputs, eos_id): | |
""" Truncate a sequence of outputs (vocabulary ids) to end before the end-of-sequence id (eos_id) |