Skip to content

Instantly share code, notes, and snippets.

View h4ste's full-sized avatar

Travis Goodwin h4ste

  • U.S. National Library of Medicine
  • Bethesda
View GitHub Profile
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 {
@h4ste
h4ste / language_utils.py
Created December 6, 2018 19:47
Language Utilities from DSRM project
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)