Skip to content

Commit

Permalink
mv out nlp
Browse files Browse the repository at this point in the history
  • Loading branch information
imgarylai committed Dec 11, 2018
1 parent 336e488 commit 9a92936
Show file tree
Hide file tree
Showing 131 changed files with 43 additions and 130,563 deletions.
17 changes: 0 additions & 17 deletions elit/cli/config.py

This file was deleted.

58 changes: 0 additions & 58 deletions elit/cli/download.py

This file was deleted.

81 changes: 0 additions & 81 deletions elit/cli/install.py

This file was deleted.

2 changes: 1 addition & 1 deletion elit/component/cnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from mxnet.gluon.data import DataLoader

from elit.component import MXComponent
from elit.nlp.embedding import Embedding
from elit.embedding import Embedding
from elit.model import CNNModel
from elit.structure import Document

Expand Down
2 changes: 1 addition & 1 deletion elit/component/mx.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from tqdm import trange

from elit.component import NLPComponent
from elit.nlp.embedding import Embedding
from elit.embedding import Embedding
from elit.structure import Document
from elit.util.mx import mx_loss

Expand Down
2 changes: 1 addition & 1 deletion elit/component/rnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from mxnet.gluon.data import DataLoader

from elit.component import MXComponent
from elit.nlp.embedding import Embedding
from elit.embedding import Embedding
from elit.model import RNNModel
from elit.structure import Document

Expand Down
10 changes: 3 additions & 7 deletions elit/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from mxnet.ndarray import NDArray
from tqdm import tqdm

from elit.nlp.embedding import Embedding, TokenEmbedding
from elit.embedding import Embedding
from elit.structure import to_gold, Sentence, Document

__author__ = "Gary Lai"
Expand Down Expand Up @@ -87,7 +87,7 @@ def argmax(self, scores: Union[np.ndarray, NDArray]) -> str:

class Dataset(gluon.data.Dataset):

def __init__(self, docs: Sequence[Document], embs: List[Union[Embedding, TokenEmbedding]], key: str, label_map: LabelMap, label: bool = True, transform=None):
def __init__(self, docs: Sequence[Document], embs: List[Union[Embedding]], key: str, label_map: LabelMap, label: bool = True, transform=None):
self._data = []
self.embs = embs
self.key = key
Expand Down Expand Up @@ -158,8 +158,4 @@ def extract(self, did, sid, sen):
self._data.append((did, sid, self.extract_sen(sen), self.extract_labels(sen)))


sequence_batchify_fn = batchify.Tuple((batchify.Stack(), batchify.Stack(), batchify.Pad(), batchify.Pad(pad_val=-1)))
# stack doc idx
# stack sen idx
# pad sen
# pad label
sequence_batchify_fn = batchify.Tuple((batchify.Stack(), batchify.Stack(), batchify.Pad(), batchify.Pad(pad_val=-1)))
Loading

4 comments on commit 9a92936

@hankcs
Copy link
Contributor

@hankcs hankcs commented on 9a92936 Dec 13, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, where is nlp now😅?

@hankcs
Copy link
Contributor

@hankcs hankcs commented on 9a92936 Dec 13, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And where shall I push my patch to😅?

@imgarylai
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for getting you back late. I was traveling in the past 2 days.
Could you create a branch for that?

@hankcs
Copy link
Contributor

@hankcs hankcs commented on 9a92936 Dec 16, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for getting you back late. I was traveling in the past 2 days.
Could you create a branch for that?
OK

Please sign in to comment.