Skip to content

Instantly share code, notes, and snippets.

View echen's full-sized avatar

Edwin Chen echen

View GitHub Profile
@echen
echen / example.py
Last active December 14, 2020 19:32
Creating NER gold standards using the API
import requests
# Replace with your API key, which you can find at https://app.surgehq.ai/me.
API_KEY = "ABCDEF"
# Replace with your project's ID.
PROJECT_ID = "XYZ"
# Retrieve the project (assuming you previously created it).
response = requests.get("https://app.surgehq.ai/api/projects/%s" % PROJECT_ID,
auth = (API_KEY, "")
@echen
echen / keras_bottleneck_multiclass.py
Created August 14, 2017 07:51 — forked from Thimira/keras_bottleneck_multiclass.py
Learn how to build a multi-class image classification system using bottleneck features from a pre-trained model in Keras to achieve transfer learning.
'''
Using Bottleneck Features for Multi-Class Classification in Keras
We use this technique to build powerful (high accuracy without overfitting) Image Classification systems with small
amount of training data.
The full tutorial to get this code working can be found at the "Codes of Interest" Brog at the following link,
http://www.codesofinterest.com/2017/08/bottleneck-features-multi-class-classification-keras.html
Please go through the tutorial before attrmpting to run this code, as it explains how to setup your training data.
@echen
echen / BookCrossing.scala
Last active May 21, 2017 20:20
Movie Recommendations and More via MapReduce and Scalding
class BookCrossing(args : Args) extends VectorSimilarities(args) {
override def input(userField : Symbol, itemField : Symbol, ratingField : Symbol) : Pipe = {
val bookCrossingRatings =
Tsv("book-crossing-ratings.tsv")
.read
.mapTo((0, 1, 2) -> (userField, itemField, ratingField)) { fields : (String, String, Double) => fields }
bookCrossingRatings
}
}
@echen
echen / categories.tsv
Created February 18, 2016 20:04
Categories
We can make this file beautiful and searchable if this error is corrected: No tabs found in this TSV file in line 0.
Agricultural Production-Crops
Agricultural Prod-Livestock & Animal Specialties
Agricultural Services
Forestry
Fishing, Hunting and Trapping
Metal Mining
Gold and Silver Ores
Miscellaneous Metal Ores
Bituminous Coal & Lignite Mining
Bituminous Coal & Lignite Surface Mining
@echen
echen / countries.tsv
Created February 18, 2016 19:48
Countries
We can make this file beautiful and searchable if this error is corrected: No tabs found in this TSV file in line 0.
Afghanistan
Åland Islands
Albania
Algeria
American Samoa
Andorra
Angola
Anguilla
Antarctica
Antigua and Barbuda
@echen
echen / countries.csv
Created February 18, 2016 19:48
Countries
We can make this file beautiful and searchable if this error is corrected: No tabs found in this TSV file in line 0.
Afghanistan
Åland Islands
Albania
Algeria
American Samoa
Andorra
Angola
Anguilla
Antarctica
Antigua and Barbuda

Haskell Code A

Here is code written in the Haskell programming language that prints the numbers 1 through 20.

mapM_ (\i -> putStrLn (show i)) [1..20]

In other words, the output of running this program is

Java Code A

Here is code written in the Java programming language that prints the numbers 1 through 20.

public class PrintOneThroughTwenty {
	public static void main(String[] args) {
		for (int i = 1; i <= 20; i++) {
			System.out.println(i);
 }
@echen
echen / Go.md
Last active November 19, 2015 00:59

Go Code A

Here is code written in the Go programming language that prints the numbers 1 through 20.

package main
 
import "fmt"
 
func main() {
@echen
echen / Ruby.md
Last active November 19, 2015 01:04

Ruby Code A

Here is code written in the Ruby programming language that prints the numbers 1 through 20.

1.upto(20) do |n|
  puts n
end