Spaces:
Sleeping
Sleeping
Karthik Uppuluri
commited on
Commit
·
6e5ac4d
1
Parent(s):
774ee0a
Fix spacy import
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ import numpy as np
|
|
5 |
import streamlit as st
|
6 |
from scipy.special import softmax
|
7 |
from simpletransformers.ner import NERModel
|
8 |
-
from spacy.
|
9 |
|
10 |
HTML_WRAPPER = """<div style="overflow-x: auto; border: 1px solid #e6e9ef; border-radius: 0.25rem; padding: 1rem; margin-bottom: 2.5rem">{}</div>"""
|
11 |
|
@@ -72,7 +72,7 @@ def format_predictions_to_display(doc,
|
|
72 |
iob_tags.append(prediction[word])
|
73 |
|
74 |
biluo_tags = iob_to_biluo(iob_tags)
|
75 |
-
tags =
|
76 |
|
77 |
for tag in tags:
|
78 |
start_token = get_token_for_char(doc, tag[0])
|
|
|
5 |
import streamlit as st
|
6 |
from scipy.special import softmax
|
7 |
from simpletransformers.ner import NERModel
|
8 |
+
from spacy.training import iob_to_biluo, biluo_tags_to_offsets
|
9 |
|
10 |
HTML_WRAPPER = """<div style="overflow-x: auto; border: 1px solid #e6e9ef; border-radius: 0.25rem; padding: 1rem; margin-bottom: 2.5rem">{}</div>"""
|
11 |
|
|
|
72 |
iob_tags.append(prediction[word])
|
73 |
|
74 |
biluo_tags = iob_to_biluo(iob_tags)
|
75 |
+
tags = biluo_tags_to_offsets(doc, biluo_tags)
|
76 |
|
77 |
for tag in tags:
|
78 |
start_token = get_token_for_char(doc, tag[0])
|