Code Monkey home page Code Monkey logo

pppi / posit Goto Github PK

View Code? Open in Web Editor NEW
6.0 3.0 2.0 52.71 MB

POSIT aims to segment and tag mixed-text that contains English and C-like code, such that the user both knows what a token is, and within the language it's used in, what role, such as an AST tag or PoS tag, it serves.

Home Page: https://pppi.github.io/POSIT/

License: MIT License

Python 99.58% Shell 0.42%
bilstm-crf-model mixed-text code-switching part-of-speech-tagging stackoverflow

posit's People

Contributors

pppi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

posit's Issues

InvalidArgumentError when evaluating model

Hey I am getting the following error when trying to evaluate the pretrained model weights. Are there any pointers you could give me, what is going on here?

input> This is a simple test sentence and a function call test().
Traceback (most recent call last):
  File "C:\Users\cake\Anaconda3\envs\posit\lib\site-packages\tensorflow\python\client\session.py", line 1356, in _do_call
    return fn(*args)
  File "C:\Users\cake\Anaconda3\envs\posit\lib\site-packages\tensorflow\python\client\session.py", line 1341, in _run_fn
    options, feed_dict, fetch_list, target_list, run_metadata)
  File "C:\Users\cake\Anaconda3\envs\posit\lib\site-packages\tensorflow\python\client\session.py", line 1429, in _call_tf_sessionrun
    run_metadata)
tensorflow.python.framework.errors_impl.InvalidArgumentError: seq_lens(0) > input.dims(1)
         [[{{node feature/bidirectional_rnn/bw/ReverseSequence}}]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "evaluate.py", line 77, in <module>
    main()
  File "evaluate.py", line 73, in main
    interactive_shell(model)
  File "evaluate.py", line 40, in interactive_shell
    preds = model.predict(words_raw)
  File "C:\Users\cake\Documents\POSIT\src\tagger\model.py", line 518, in predict
    pred = self.predict_batch([words])
  File "C:\Users\cake\Documents\POSIT\src\tagger\model.py", line 391, in predict_batch
    feed_dict=fd)
  File "C:\Users\cake\Anaconda3\envs\posit\lib\site-packages\tensorflow\python\client\session.py", line 950, in run
    run_metadata_ptr)
  File "C:\Users\cake\Anaconda3\envs\posit\lib\site-packages\tensorflow\python\client\session.py", line 1173, in _run
    feed_dict_tensor, options, run_metadata)
  File "C:\Users\cake\Anaconda3\envs\posit\lib\site-packages\tensorflow\python\client\session.py", line 1350, in _do_run
    run_metadata)
  File "C:\Users\cake\Anaconda3\envs\posit\lib\site-packages\tensorflow\python\client\session.py", line 1370, in _do_call
    raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: seq_lens(0) > input.dims(1)
         [[node feature/bidirectional_rnn/bw/ReverseSequence (defined at C:\Users\cake\Documents\POSIT\src\tagger\model.py:229) ]]

Errors may have originated from an input operation.
Input Source operations connected to node feature/bidirectional_rnn/bw/ReverseSequence:
 feature/Reshape_1 (defined at C:\Users\cake\Documents\POSIT\src\tagger\model.py:223)
 feature/Cast (defined at C:\Users\cake\Documents\POSIT\src\tagger\model.py:228)

Original stack trace for 'feature/bidirectional_rnn/bw/ReverseSequence':
  File "evaluate.py", line 77, in <module>
    main()
  File "evaluate.py", line 65, in main
    model = restore_model(config)
  File "evaluate.py", line 56, in restore_model
    model.build()
  File "C:\Users\cake\Documents\POSIT\src\tagger\model.py", line 367, in build
    self.add_word_embeddings_op()
  File "C:\Users\cake\Documents\POSIT\src\tagger\model.py", line 229, in add_word_embeddings_op
    sequence_length=feature_sizes, dtype=tf.float32)
  File "C:\Users\cake\Anaconda3\envs\posit\lib\site-packages\tensorflow\python\util\deprecation.py", line 324, in new_func
    return func(*args, **kwargs)
  File "C:\Users\cake\Anaconda3\envs\posit\lib\site-packages\tensorflow\python\ops\rnn.py", line 493, in bidirectional_dynamic_rnn
    inputs_reverse = nest.map_structure(_map_reverse, inputs)
  File "C:\Users\cake\Anaconda3\envs\posit\lib\site-packages\tensorflow\python\util\nest.py", line 515, in map_structure
    structure[0], [func(*x) for x in entries],
  File "C:\Users\cake\Anaconda3\envs\posit\lib\site-packages\tensorflow\python\util\nest.py", line 515, in <listcomp>
    structure[0], [func(*x) for x in entries],
  File "C:\Users\cake\Anaconda3\envs\posit\lib\site-packages\tensorflow\python\ops\rnn.py", line 491, in _map_reverse
    batch_axis=batch_axis)
  File "C:\Users\cake\Anaconda3\envs\posit\lib\site-packages\tensorflow\python\ops\rnn.py", line 480, in _reverse
    batch_axis=batch_axis)
  File "C:\Users\cake\Anaconda3\envs\posit\lib\site-packages\tensorflow\python\util\deprecation.py", line 507, in new_func
    return func(*args, **kwargs)
  File "C:\Users\cake\Anaconda3\envs\posit\lib\site-packages\tensorflow\python\util\deprecation.py", line 507, in new_func
    return func(*args, **kwargs)
  File "C:\Users\cake\Anaconda3\envs\posit\lib\site-packages\tensorflow\python\ops\array_ops.py", line 3341, in reverse_sequence
    name=name)
  File "C:\Users\cake\Anaconda3\envs\posit\lib\site-packages\tensorflow\python\ops\gen_array_ops.py", line 9566, in reverse_sequence
    seq_dim=seq_dim, batch_dim=batch_dim, name=name)
  File "C:\Users\cake\Anaconda3\envs\posit\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 788, in _apply_op_helper
    op_def=op_def)
  File "C:\Users\cake\Anaconda3\envs\posit\lib\site-packages\tensorflow\python\util\deprecation.py", line 507, in new_func
    return func(*args, **kwargs)
  File "C:\Users\cake\Anaconda3\envs\posit\lib\site-packages\tensorflow\python\framework\ops.py", line 3616, in create_op
    op_def=op_def)
  File "C:\Users\cake\Anaconda3\envs\posit\lib\site-packages\tensorflow\python\framework\ops.py", line 2005, in __init__
    self._traceback = tf_stack.extract_stack()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.