Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the word level to char level, I get acc 0 #3

Open
hertz-pj opened this issue Jun 14, 2019 · 3 comments
Open

Change the word level to char level, I get acc 0 #3

hertz-pj opened this issue Jun 14, 2019 · 3 comments

Comments

@hertz-pj
Copy link

No description provided.

@hertz-pj
Copy link
Author

hertz-pj commented Jun 14, 2019

When I use your model to train on the TREC datasets, I found something interesting. If I change the your read_TREC function like this:

def read_TREC():
    data = {}

    def read(mode):
        x, y = [], []

        with open("../data/TREC/TREC_" + mode + ".txt", "r", encoding="utf-8") as f:
            for line in f:
                if line[-1] == "\n":
                    line = line[:-1]
                y.append(line.split(":")[0])
                x.append(line.split(":")[1])

        x, y = shuffle(x, y)

        if mode == "train":
            dev_idx = len(x) // 10
            data["dev_x"], data["dev_y"] = x[:dev_idx], y[:dev_idx]
            data["train_x"], data["train_y"] = x[dev_idx:], y[dev_idx:]
        else:
            data["test_x"], data["test_y"] = x, y

    read("train")
    read("test")

    return data

I get the very high Accuracy 0.97+

@zhangmingfang123
Copy link

I want to classify Chinese sentences with about 50 words. Is this model effective?

@zhangmingfang123
Copy link

As for the question I raised above, do you have any suggestions for model changes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants