coatk1 / playground

testing and experimenting with everything
https://coatk1.github.io/playground/
MIT License
0 stars 1 forks source link

Links #96

Open coatk1 opened 3 years ago

coatk1 commented 1 year ago
## Source: https://github.com/allenai/scispacy/issues/141#issuecomment-518274586
## Author: https://github.com/phosseini
##   File: /mnt/Vancouver/apps/spacy/entity_options.py
##    Env: Python 3.7 venv:
##    Use:
##          import entity_options
##          from entity_options import get_entity_options
##          displacy.serve(doc, style="ent", options=get_entity_options(random_colors=True))
##    Ent: https://github.com/allenai/scispacy/issues/79#issuecomment-557766506 ## CRAFT entities

import random 

def get_entity_options(random_colors=False):
    """ generating color options for visualizing the named entities """

    def color_generator(number_of_colors):
        color = ["#"+''.join([random.choice('0123456789ABCDEF') for j in range(6)]) for i in range(number_of_colors)]
        return color

    entities = ["GGP", "SO", "TAXON", "CHEBI", "GO", "CL", "DNA", "CELL_TYPE", "CELL_LINE", "RNA", "PROTEIN", \
                "DISEASE", "CHEMICAL", "CANCER", "ORGAN", "TISSUE", "ORGANISM", "CELL", "AMINO_ACID", \
                "GENE_OR_GENE_PRODUCT", "SIMPLE_CHEMICAL", "ANATOMICAL_SYSTEM", "IMMATERIAL_ANATOMICAL_ENTITY", \
                "MULTI-TISSUE_STRUCTURE", "DEVELOPING_ANATOMICAL_STRUCTURE", "ORGANISM_SUBDIVISION", "CELLULAR_COMPONENT"]

    colors = {"ENT":"#E8DAEF"}

    if random_colors:
        color = color_generator(len(entities))
        for i in range(len(entities)):
            colors[entities[i]] = color[i]
    else:
        entities_cat_1 = {"GGP":"#F9E79F", "SO":"#F7DC6F", "TAXON":"#F4D03F", "CHEBI":"#FAD7A0", "GO":"#F8C471", "CL":"#F5B041"}
        entities_cat_2 = {"DNA":"#82E0AA", "CELL_TYPE":"#AED6F1", "CELL_LINE":"#E8DAEF", "RNA":"#82E0AA", "PROTEIN":"#82E0AA"}
        entities_cat_3 = {"DISEASE":"#D7BDE2", "CHEMICAL":"#D2B4DE"}
        entities_cat_4 = {"CANCER":"#ABEBC6", "ORGAN":"#82E0AA", "TISSUE":"#A9DFBF", "ORGANISM":"#A2D9CE", "CELL":"#76D7C4", \
                          "AMINO_ACID":"#85C1E9", "GENE_OR_GENE_PRODUCT":"#AED6F1", "SIMPLE_CHEMICAL":"#76D7C4", "ANATOMICAL_SYSTEM":"#82E0AA", \
                          "IMMATERIAL_ANATOMICAL_ENTITY":"#A2D9CE", "MULTI-TISSUE_STRUCTURE":"#85C1E9", "DEVELOPING_ANATOMICAL_STRUCTURE":"#A9DFBF", \
                          "ORGANISM_SUBDIVISION":"#58D68D", "CELLULAR_COMPONENT":"#7FB3D5"}

        entities_cats = [entities_cat_1, entities_cat_2, entities_cat_3, entities_cat_4]
        for item in entities_cats:
            colors = {**colors, **item}

    options = {"ents": entities, "colors": colors}
    # print(options)
    return options
coatk1 commented 1 year ago

https://stackoverflow.com/questions/64622841/using-conda-build-to-build-win32-and-win64-packages-in-1-go

coatk1 commented 8 months ago

https://towardsdatascience.com/visualizing-survivors-tv-show-data-set-castaways-personalities-and-voting-teams-patterns-a56774dda2a6

coatk1 commented 6 months ago
coatk1 commented 5 months ago

https://www.alphr.com/computer-monitor-flickering/ https://scikit-learn.org/stable/user_guide.html https://scikit-learn.org/stable/api/index.html https://huggingface.co/

https://huggingface.co/docs/transformers/model_doc/bert#transformers.BertForSequenceClassification.forward.example-2 https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2 https://towardsdatascience.com/clustering-sentence-embeddings-to-identify-intents-in-short-text-48d22d3bf02e https://cohere.com/blog/text-embeddings https://www.sbert.net/examples/applications/semantic-search/README.html

https://maartengr.github.io/BERTopic/index.html https://huggingface.co/blog/bertopic https://www.trychroma.com/ https://umap-learn.readthedocs.io/en/latest/parameters.html https://hdbscan.readthedocs.io/en/latest/parameter_selection.html https://scikit-learn.org/stable/modules/generated/sklearn.cluster.HDBSCAN.html

https://distinctipy.readthedocs.io/en/latest/usage.html https://plotly.com/python-api-reference/index.html https://plotly.com/python/ https://plotly.com/python/reference/scatter/ https://plotly.com/python/reference/layout/

https://code.visualstudio.com/docs/datascience/jupyter-notebooks#_connect-to-a-remote-jupyter-server

https://huggingface.co/docs/transformers/en/tasks/token_classification https://www.kaggle.com/code/thanish/bert-for-token-classification-ner-tutorial https://discuss.huggingface.co/t/fine-tune-bert-with-two-classification-heads-next-to-each-other/9984 https://discuss.huggingface.co/t/how-do-i-change-the-classification-head-of-a-model/4720 https://stackoverflow.com/questions/62337074/adding-new-labels-to-an-already-trained-bert-model https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_bert.py#L1176

https://pytorch.org/docs/stable/generated/torch.Tensor.unfold.html https://pytorch.org/tutorials/beginner/basics/data_tutorial.html https://pytorch.org/docs/stable/data.html https://huggingface.co/docs/transformers/main_classes/trainer

https://www.geeksforgeeks.org/sweetviz-automated-exploratory-data-analysis-eda/ https://docs.profiling.ydata.ai/latest/